How can I correctly query the OrderAdjustment object?

How can I correctly query the OrderAdjustment object?

Yuxin_x
Shopify Partner
7 0 0

Hi everyone!!

 

Do you know how to query orderAdjustment object? ( Order Adjustment: https://shopify.dev/api/admin/graphql/reference/orders/orderadjustment)

 

I've tried using it in Order:

 

{
  order(id: "gid://shopify/Order/123") {
    orderAdjustments(first:10) {
      edges {
        node {
          id
        }
      }
    }
  }
}

 

And Refund:

 

{
  order(id: "gid://shopify/Order/123") {
    refunds(first:10){
      orderAdjustments(first:10) {
        edges {
          node {
            id
          }
        }
      }	
    }
  }
}

 

None of them are working yet. 

 

I got the following error: 

 

"Field 'orderAdjustments' doesn't exist on type 'Order'"
"Field 'orderAdjustments' doesn't exist on type 'Refund'"

 

 

 

There was a previous post about this, however the query is no longer working: https://community.shopify.com/c/shopify-apis-and-sdks/refunding-using-the-graphql-api-querying-the-e...

I've tried both older and the latest 2021-07 App version ~

Thank you in advance! 

Replies 2 (2)

jaycean
Visitor
2 0 0

Hi, I also have the same problem I have tried everything but nothing works.

Yuxin_x
Shopify Partner
7 0 0

Hi @jaycean 

 

I heard back from Shopify Staff, it seems the OrderAdjustment is still only available on the `unstable` version, at the time of this writing. I tried unstable one and it worked.. 🙂 

/admin/api/unstable/graphql.json

 

https://community.shopify.com/c/shopify-apis-and-sdks/refunding-using-the-graphql-api-querying-the-e...