In Magento 2, especially when building custom frontends with PWA Studio, Vue Storefront, or any headless frontend using GraphQL, it’s important to know whether a customer’s email is already registered before account creation.
Magento provides a simple query for this: isEmailAvailable
.
But starting from Magento 2.4.7, its behavior has slightly changed and may lead to confusion if you’re unaware of the config setting involved. Let’s break it down.
What is isEmailAvailable
?
The isEmailAvailable
GraphQL query allows you to verify if an email address is already associated with an existing customer account.
- Returns
true
if the email is available to create a new account. - Returns
false
if the email is already in use.
But in Magento 2.4.7 and later, the behavior is modified for privacy and security reasons.
Important Change in Magento 2.4.7
By default, Magento 2.4.7 always returns:
{
"data": {
"isEmailAvailable": {
"is_email_available": true
}
}
}
Even for already registered emails.
Why?
To prevent exposing customer data (like whether someone’s email exists on your store), Magento now hides that information unless you explicitly allow it.
How to Enable Real Email Availability Check?
To restore the actual checking behavior:
- Go to your Magento Admin
- Navigate to:
Stores > Configuration > Sales > Checkout
- Set Enable Guest Checkout Login to Yes
⚠️ Warning: Enabling this will reveal email existence status to unauthenticated users, which could lead to privacy concerns.
GraphQL Syntax
{
isEmailAvailable(email: "customer@example.com") {
is_email_available
}
}
Parameters
- email (String!): The email you want to check.
Example Usage
Request
{
isEmailAvailable(email: "hello@jigarkarangiya.com") {
is_email_available
}
}
Response
{
"data": {
"isEmailAvailable": {
"is_email_available": true
}
}
}
- true → Email is available
- false → Email is already in use
When to Use This?
In custom signup flows to give users instant feedback
During customer registration on headless frontends
For progressive web apps (PWAs)
Related Resources
The isEmailAvailable
GraphQL query is a useful tool in building smarter and user-friendly registration forms for your Magento 2 store. But with Magento 2.4.7, don’t forget the behavior change — it now always returns true
unless you configure it otherwise.
You may also like,
Leave a Comment