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?
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.