We recently encountered difficulty using Shopify API to find a customer by email. We found a solution in this Shopify forum post:
This solution seems to rely on a strange undocumented Shopify API feature. Could we get some clarity on this? Is this really a feature of Shopify API? Is it a bug? Should it be documented?
The customer in question: gid://shopify/Customer/5421928382632
This query WORKS:
{ customers(first:1, query:"email:'REDACTED") { edges { node { id email } } } }
This query DOES NOT WORK:
{ customers(first:1, query:"email:REDACTED") { edges { node { id email } } } }
This query DOES NOT WORK:
{ customers(first:1, query:"email:'REDACTED'") { edges { node { id email } } } }
So according to our tests, the only version that works is a query that has a single quote following the colon.
Note that the email in question has non-Latin characters but we are not sure if this is important.