How to get customer id using graphQl?
Frage
I am getting below data on
customer data GraphQL query
const query = () => ({
query:
{
customer {
customer_id
firstname
lastname
suffix
email
addresses {
id
firstname
lastname
street
city
default_billing
default_shipping
region {
region_code
region
}
postcode
country_code
telephone
}
}
}
})
{
customer: {
id: null,
firstname: 'User',
lastname: 'User',
suffix: null,
email: 'User@user.com',
addresses: []
}
}
How to get customer id in this ?
Lösung
In graphql id
is deprecated!
When you see schema for customer, it will show id is deprecated!
As per file
id is not needed as part of Customer because on server side it can be identified based on customer token used for authentication. There is no need to know customer ID on the client side.
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit magento.stackexchange