A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hi,
I would like to know what exactly is currentQuantity in this following query
{ order(id: "<any id>") { lineItems(first: 20) { nodes { sku currentQuantity unfulfilledQuantity } } } }
I use it to know how many of a sku I fulfilled by doing current - unfulfilled, it works fine but sometimes I have an order wich I have 0 in currentQuantity, but I fulfilled them...
I thought currentQuantity was the field quantity - refunded quantity as it works for most of my operations.
thanks a lot in advance
Solved! Go to the solution
This is an accepted solution.
Nevermind, I will try something else as this will never work how I want it to work, thanks anyway
Hi There,
According to the documentation currentQuantity:
The line item's quantity, minus the removed quantity.
If you want to find out how many you need to fulfill for the order you need 'unfulfilledQuantity'.
But you should really be using the quantities available on the fulfillmentOrder endpoint instead of the order lineItems
Hi,
thanks for the reply,
I should have precised that I am using a bulk operation, so can't nest more than 2 connections or else I have this error: Bulk queries cannot contain connections with a nesting depth greater than 2
and also because it's a bulk query I have Queries that contain a connection field within a list field are not currently supported
that's why I don't/can't use every field I want (or I have to query 2x for the same order) (yes i'm struggle on this since a long time)
And I want to find how many I already fulfilled not unfulfilled, I have remainingQuantity for that
here is my request to have a better view:
mutation {
bulkOperationRunQuery(
query:"""
{
orders(query:"created_at:>='${date.toISOString().split('.')[0]}Z' AND (fulfillment_status:shipped OR fulfillment_status:partial)"){
edges{
node{
id, name,
lineItems{
edges{
node{
id,
sku,
currentQuantity,
unfulfilledQuantity
}
}
}
fulfillmentOrders {
edges {
node {
id,
lineItems {
edges {
node {
id, remainingQuantity, totalQuantity, sku
}
}
}
fulfillments {
edges {
node {
id
trackingInfo {
number
}
}
}
}
}
}
}
}
}
}
}
"""
) {
bulkOperation {
id
status
}
userErrors {
field
message
}
}
}
This is an accepted solution.
Nevermind, I will try something else as this will never work how I want it to work, thanks anyway