Hi all!
I’ve run into an odd issue here searching though customers by their email. Here’s the query:
query GetCustomers($query: String!) {
customers(query: $query, first: 1) {
nodes {
id
locale
}
}
}
And my input:
{
"query": "email:sometesting@emailaddress.com"
}
In this case, I’ve used this email address multiple times for testing purposes, meaning I’ve created then deleted an account that was using this email.
So now when I make the query, if the first parameter is set to 1, the API will return an empty array even though there is an actual customer using the queried email address.
If I increment the first parameter, then I will end up getting my customer once I reach the value of the amount of previously deleted customer.
This also happens if a customer first subscribed using a first email address, then changed it. If another customer is created using the initial email address, I will end up retrieving both customers linked to the same email address, even though only one is currently using it.
For information, this doesn’t occur on the REST API, only on the GraphQL admin API.
How could we solve this issue?
It’s important to mention that the email address is the only data available to me on this specific workflow, querying by id is not an option.
Thanks for the help!