A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
I'm trying to get the orders with email attribute not null.
I tried with this query but I always get an empty result set:
{ orders(first: 180, query: "email:*") { edges { node { id name email shippingLines (first:10) { edges { node { code } } } } } } }
If I remove the "query" filter I get several results.
I tried with different API versions until 2024-04 but the behaviour is always the same.
Solved! Go to the solution
This is an accepted solution.
Hey @alessmar ,
Thanks for sharing that. Testing here, I do notice that in the format you've shared, it's returning all orders, regardless of if there is a null email or not.
When I add a greater-than-or-equal-to comparator, it returns only the orders that have an email.
orders(first: 180, query: "email:>=*")
Hope that helps,
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
This is an accepted solution.
Hey @alessmar ,
Thanks for sharing that. Testing here, I do notice that in the format you've shared, it's returning all orders, regardless of if there is a null email or not.
When I add a greater-than-or-equal-to comparator, it returns only the orders that have an email.
orders(first: 180, query: "email:>=*")
Hope that helps,
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