Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

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

Re: GraphQL filter on order query does not work

Solved

GraphQL filter on order query does not work

jordanA
Shopify Partner
5 1 3

I've run a query on orders and i'd like to filter it by fulfillment status.
It looks like it does not work.

Screenshot 2023-05-17 at 16.19.18.png

Accepted Solution (1)
jordanA
Shopify Partner
5 1 3

This is an accepted solution.

Great ! It works !
Should the doc be updated on this subject because it's very confusing to have the fulfillment status uppercase in the response and lowercase in the query ?

Tks for the help on this.

View solution in original post

Replies 5 (5)

ShopifyDevSup
Shopify Staff
1453 239 535

Hi @jordanA 👋

 

Would you please try `{ query: "fulfillment_status:unfulfilled" }` instead? 

 

 

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

jordanA
Shopify Partner
5 1 3

This is an accepted solution.

Great ! It works !
Should the doc be updated on this subject because it's very confusing to have the fulfillment status uppercase in the response and lowercase in the query ?

Tks for the help on this.

ShopifyDevSup
Shopify Staff
1453 239 535

Hi @jordanA,

 

Thanks for your reply and feedback. We are indeed looking to improve the query sections of the GraphQL documentation. 

 

A great way to suggest a doc update that helps to indicate interest is to find the 'Was this section helpful?' box below the section on the doc page that was being referenced and click 'No' and provide a little bit of detail in the feedback box in your own words.

 

Hope you have a great day,
Jon551

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

phester17
Shopify Partner
22 1 15

Hi @ShopifyDevSup,

 

This seems like a bug because the query filters are usually case insensitive.

 

Do you know why only the orders statuses such as financial_status and return_status require lowercase?

ShopifyDevSup
Shopify Staff
1453 239 535

Hey @phester17 , this is a great question. 

 

I'm just testing on my own here, as well as consulting our documentation on search query syntax and it seems to be working as expected. 

 

Term search is a case insensitive search of all documents, however with a field search, the field is case sensitive and if invalid, it's ignored and all results are returned. 

For example, using fulfillment_status: unfulfilled, the actual status is case insensitive and works either way: 

 

fulfillment_status: unfulfilled

fulfillment_status: UNFULFILLED

 

Both will work, however 

 

Fulfillment_Status: unfulfilled will not work as the field we are querying remains case sensitive. 

 

Just to double check I wasn't missing anything I tested on another field that hasn't been mentioned here, discount_code: 

 

query: "discount_code:product50" works just fine, as well query: "discount_code:PRODUCT50" also works, but query: "Discount_Code:product50" will be ignored. 

 

Hope that helps clear it up! 

 

- Kyle G.

 

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog