Skip to main content
Version: 1.0.0

IsEmailAvailableQuery

Description

Checks whether a specified email address has already been used to create a customer account. This query is useful for validating email addresses during the registration process to ensure they are unique.

Endpoint

query isEmailAvailable($email: String!) {
isEmailAvailable(email: $email) {
is_email_available
}
}

Arguments

ArgumentTypeRequiredDescription
emailStringYesThe email address to check for availability.

Return Values

The query returns an IsEmailAvailableType object with the following field:

FieldTypeDescription
is_email_availableBooleanIndicates whether the specified email address is available for use. Returns true if the email is available (not already used by a customer), or false if the email is already in use.

Usage Example

query {
isEmailAvailable(email: "customer@example.com") {
is_email_available
}
}

Example Response

{
"data": {
"isEmailAvailable": {
"is_email_available": true
}
}
}

Notes

  • This query is useful for real-time validation in registration forms to provide immediate feedback to users.
  • If the email is already associated with a customer account, is_email_available will be false.
  • If the email is not associated with any customer account, is_email_available will be true.
  • The query performs a case-insensitive check, so "user@example.com" and "USER@example.com" are considered the same email.
  • If an error occurs during the check, the query will default to returning false for safety reasons.