Liquid, JavaScript, themes, sales channels
Hello,
Hope you can help me. I noticed for the actual quantity in an order I need to use currentQuantity and not quantity. See:
https://shopify.dev/docs/admin-api/graphql/reference/orders/lineitem#fields-2021-04
But unfortunately I get this errormessage in return:
{"errors":[{"message":"Field 'currentQuantity' doesn't exist on type 'LineItem'","locations":[{"line":1,"column":176}],"path":["query","orders","edges","node","lineItems","edges","node","currentQuantity"],"extensions":{"code":"undefinedField","typeName":"LineItem","fieldName":"currentQuantity"}}]}
See the template I use. Without field currentQuantity the query works fine.
{"query":"query{orders(query:\"status:open\",first:${ordernumbers}<#if cursor??>, after: \"${cursor}\"</#if>){pageInfo{hasNextPage,hasPreviousPage},edges{cursor,node{name,displayFulfillmentStatus,lineItems(first: 3) {edges {node {id,quantity,currentQuantity,fulfillmentStatus,product{id},variant{id},title,variantTitle,sku,discountedUnitPriceSet{shopMoney{amount,currencyCode}}}}}id,email,createdAt,customer{id},discountCode,totalDiscountsSet{shopMoney{amount}},totalShippingPriceSet{shopMoney{amount}},shippingAddress{firstName,lastName,address1,address2,city,zip,country,phone}}}}}"}
Thanks in advance,
Paul
Solved! Go to the solution
This is an accepted solution.
Hi,
are you sure you're using the latest API version (2021-04) in your app? Looks like the field wasn't present in 2021-01 and older API versions.
Hope I guessed it right 😉
Regards,
Manuel
This is an accepted solution.
Hi,
are you sure you're using the latest API version (2021-04) in your app? Looks like the field wasn't present in 2021-01 and older API versions.
Hope I guessed it right 😉
Regards,
Manuel
Thanks Manuel, I did not realise there is already a later version available. The call works fine now!
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024