How to filter customer based on email on the graphql API

Hello

How can i query the amount spend for a particular user using the graphql api .

I have tried this one

{
customers(first:5){
edges{
node
{
email
amountSpent{
amount
currencyCode
}
}
}
}
}

Instead of the first:5 i have to pass the email id and get the amountSpent of that particular user.

Hi @Pjijin ,

Thank you for reaching out to the Shopify community.

You can fetch a particular customer by email as I have explained below:

{
    customers(first: 1, query: "email:customeremail@domain.com") {
        edges {
            node {
                email
                amountSpent {
                    amount
                    currencyCode
                }
            }
        }
    }
}

Please replace "customeremail@domain.com" with the desired email to get the specific customer.

Thank you,