Trying to query fulfilled orders using GraphQL, but the following keep pulling all orders:
{
orders(first: 50, query:"fulfillment_status:fulfilled") {
edges {
node {
id
name
note
createdAt
displayFinancialStatus
displayFulfillmentStatus
totalPriceSet {
shopMoney {
amount
}
}
customer {
id
displayName
}
}
}
}
}
What am I doing wrong? Also would look to use other filter params in the same query like created_at and wondering how to do multiple calls in the same query. Looked through https://help.shopify.com/en/api/getting-started/search-syntax but if I’m reading it right, the above should work. Not sure what I’m missing here.
Hi @bmarshall511 ,
The fulfillment_status is actually wrong. The documentation is lacking for GraphQL.
The valid fulfillment_status values can be found here.
Filter orders by their fulfillment status.
(default: any)
shipped: Show orders that have been shipped.
partial: Show partially shipped orders.
unshipped: Show orders that have not yet been shipped
any: Show orders of any fulfillment status.
So your request should be:
{
orders(first: 50, query:"fulfillment_status:shipped") {
edges {
node {
id
name
note
createdAt
displayFinancialStatus
displayFulfillmentStatus
totalPriceSet {
shopMoney {
amount
}
}
customer {
id
displayName
}
}
}
}
}
Hope it helps!
5 Likes
Thanks, but that’s actually for the RestAPI, I’m using graphql. Was able to figure it out with the “:<=” comparer.
ex: fulfillment_status:<=fulfilled
Yes, I know. The REST and GraphQL API use the same valid values for the fulfillment_status and from what I saw that part is missing from the GraphQL documentation.
Anyways, glad it worked out for you.
Thank you Emil, your answer is indeed right, it saved me quite a bit of time trying to figure out why it wasn’t working.
Hi all,
This still doesn’t work for me. If I filter by the “null” value I still get fulfillable=true
## Filtering connections using the query parameter
{
orders(first:10, query:"fulfillment_status:null") {
edges {
node {
id
name
displayFulfillmentStatus
fulfillable
}
}
}
}
I found that this requires “status:any” in the query in order for the “fulfillment_status” to function as advertised.
So something like this:
{
orders(first:10, query:"status:any&fulfillment_status:UNFULFILLED") {
edges {
node {
id
name
displayFulfillmentStatus
}
}
}
}
This seems to have changed recently. Try using one of these:
fulfillment_status:unshipped
fulfillment_status:shipped
-fulfillment_status:unshipped
-fulfillment_status:shipped
2 Likes