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
I send this query:
{ orders(first: 250, query: "tag_not:'test'") { edges { node { id processedAt } } pageInfo { hasNextPage endCursor } } }
to endpoint admin/api/2023-07/graphql.json.
Instead of getting a list of orders that do not contain this tag, I get an empty array.
If I use the "tag" parameter, the api returns the correct response with an array of orders.
Moreover, within the same application, "tag_not" works for one shop, but does not work for the rest shops.
Hi @dmitry,
I came across this thread from @Alan. It looks like your syntax is similar to what was causing the issue there, so perhaps make the suggested adjustments and retry.
Good luck!
Thanks @jpola12
Yes, indeed, this solution works when we have just one condition with the tag_not parameter, but if there are 2 tag_not parameters this solution does not work, for example:
tag_not: Test AND tag_not: Test2
Maybe something like this could work for you?
{
orders(first: 10, query: "(fulfillment_status:unfulfilled) AND (tag_not:'SomethingElse') AND (tag_not:'SomeThing') " ) {
nodes {
id
}
}
}
Hi Vinnc87,
This does seem pretty weird, here's two things to check:
Check the above and let me know if you're still seeing this issue.
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me 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
Hi @Liam
1) Yes, some orders have 'Test' and 'Test2' tags
2) No, our app doesn't have this scope, only read_orders and write_orders
Can you add the `read_all_orders` scope and test this again?
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me 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