GraphQL Exists Query

ebroberg
Tourist
10 0 0

Hello,

Either the GraphQL docs are wrong, or there is a bug in the EXISTS query in the Shopify GraphQL API.

 

From the docs:

The exists query will match documents with a non-NULL value in the specified field. query=published_at:*

This query can be combined with a Not Query to find fields missing a value, e.g. -published_at:*

 

However, I'm trying to retrieve all orders that have an email address on them.

 

Adding "email:*" to the query returns orders that have an email value of null.

 

Adding "-email:*" to the query returns nothing (even though we have orders in our system that have an email value of null that should match).

 

Please advise. Is this a known bug, or is the documentation incorrect?

0 Likes
_JB
Shopify Staff
Shopify Staff
824 97 179

Hey @ebroberg,

 

Thanks for raising this issue. I've been able to replicate the behaviour, so I've sent this up to our developers for further investigation. This was actually raised on another forum post as well, so just to keep everything in the same place I will be updating this post as soon I have something to share. Please follow along there, and don't hesitate to reach out if there are any questions I can answer.

JB | Developer Support @ 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

0 Likes
mnf
Tourist
9 0 0

This issue has been around for a long time and there still isn't a fix.  Will you please provide an update?

0 Likes