From fafd36207bcc9cfd71e34792decef6745609e2fa Mon Sep 17 00:00:00 2001 From: Kevin Harper Date: Wed, 21 Oct 2020 10:33:17 -0500 Subject: [PATCH] Break symlink --- .../mutations/generate-customer-token.md | 81 ++++++++++++++++++- 1 file changed, 80 insertions(+), 1 deletion(-) mode change 120000 => 100644 src/guides/v2.4/graphql/mutations/generate-customer-token.md diff --git a/src/guides/v2.4/graphql/mutations/generate-customer-token.md b/src/guides/v2.4/graphql/mutations/generate-customer-token.md deleted file mode 120000 index 636ef189054..00000000000 --- a/src/guides/v2.4/graphql/mutations/generate-customer-token.md +++ /dev/null @@ -1 +0,0 @@ -../../../v2.3/graphql/mutations/generate-customer-token.md \ No newline at end of file diff --git a/src/guides/v2.4/graphql/mutations/generate-customer-token.md b/src/guides/v2.4/graphql/mutations/generate-customer-token.md new file mode 100644 index 00000000000..fe634a936b1 --- /dev/null +++ b/src/guides/v2.4/graphql/mutations/generate-customer-token.md @@ -0,0 +1,80 @@ +--- +group: graphql +title: generateCustomerToken mutation +--- + +Use the `generateCustomerToken` mutation to create a new customer token. + +To return or modify information about a customer, Magento recommends you use customer tokens in the header of your GraphQL calls. However, you also can use [session authentication]({{ page.baseurl }}/get-started/authentication/gs-authentication-session.html). + +## Syntax + +```graphql +mutation { + generateCustomerToken( + email: String! + password: String! + ) { + CustomerToken + } +} +``` + +## Example usage + +The following call creates a new customer token. + +**Request:** + +```graphql +mutation { + generateCustomerToken( + email: "bobloblaw@example.com" + password: "b0bl0bl@w" + ) { + token + } +} +``` + +**Response:** + +```json +{ + "data": { + "generateCustomerToken": { + "token": "ar4116zozoagxty1xjn4lj13kim36r6x" + } + } +} +``` + +## Input attributes + +The `generateCustomerToken` mutation requires the following inputs: + +Attribute | Data Type | Description +--- | --- | --- +`email` | String | The customer's email address +`password` | String | The customer's password + +## Output attributes + +The `generateCustomerToken` mutation returns a valid token for the customer. + +Attribute | Data Type | Description +--- | --- | --- +`token` | String | The customer token + +## Errors + +Error | Description +--- | --- +`Specify the "email" value.` | The value specified in the `email` argument is empty. +`Specify the "password" value.` | The value specified value in the `password` argument is empty. +`The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later.` | Authentication error. The email or password is incorrect, or the customer account is locked. + +## Related topics + +* [customer query]({{page.baseurl}}/graphql/queries/customer.html) +* [revokeCustomerToken mutation]({{page.baseurl}}/graphql/mutations/revoke-customer-token.html)