I am using the customer api with query option to search customer by email, something like the following.
GET /admin/customers/search.json?query=email:test@gmail.com&fields=email,id
however, the result comes back with users with emails like
test+1@gmail.com
test+2@gmail.com
test+3@gmail.com
Is there a way to force exact match?
Technically, those are all the same email address since mail sent to all three of those will arrive at test@gmail.com via the "+" alias functionality in Gmail.
https://gmail.googleblog.com/2008/03/2-hidden-ways-to-get-more-from-your.html
That is true, they are gmail aliases, but within Shopify they are different customers complete with unique customer IDs.
Is there a way to have the graphql query return only the exact match?
I know that I can loop through what is returned and find the exact match, then perform a subsequent query using that ID, but it would be nice (and more efficient) to do everything in one trip.
Running into this same issue now, where query for test@gmail.com returns results for
test@gmail.com
test+1@gmail.com
test+2@gmail.com
and yet querying email with test+1@gmail.com returns a single result.
Some flag or regex format for email matching would be preferred, or advising on how we can do this search especially now that the api is paginated would be appreciated
User | Count |
---|---|
28 | |
7 | |
7 | |
6 | |
5 |