-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Updating customer endpoint topic with mutations #3818
Conversation
…m_magento-graphqlCustomer
…m_magento-graphqlCustomer
|
||
Currently, GraphQL relies on [session authentication]({{ page.baseurl }}/get-started/authentication/gs-authentication-session.html). To successfully return information about a customer, you must be logged in as a customer in the same browser you are using to make GraphQL calls. The GraphQL call returns information about this customer. | ||
Currently, GraphQL relies on [session authentication]({{ page.baseurl }}/get-started/authentication/gs-authentication-session.html). To successfully return or modify information about a customer, you must be logged in as a customer in the same browser you are using to make GraphQL calls. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is outdated. You can specify a customer token in the header to perform all the tasks in this topic except for generating the customer token. Session authentication still works, though.
Rewrirte this paragraph to favor customer tokens.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rewrote
`default_billing` | String | The ID assigned to the billing address | ||
`default_shipping` | String | The ID assigned to the shipping address | ||
`dob` | String | The customer's date of birth | ||
`taxvat` | String | The customer's Tax/VAT number (for corporate customers) | ||
`email` | String | The customer's email address. Required |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`email` | String | The customer's email address. Required | |
`email` | String | The customer's email address. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed required
|
||
#### Example usage | ||
|
||
The following call updates the first and last name and email address for a specific customer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't change the lastname or password in this example--that's a bit too much.
(Drop the "s" from the email values and from the lastname output value. )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
`prefix` | String | An honorific, such as Dr., Mr., or Mrs. | ||
`region` | CustomerAddressRegion | An object containing the region name, region code, and region ID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a link to the new CustomerAddressRegion section (discussed below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added link
``` | ||
### Delete customer address | ||
|
||
Uses the customer's address `id` to delete the address. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deletes the specified customer address.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
|
||
#### Syntax | ||
|
||
`mutation: generateCustomerToken` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the same format shown in the Graphiql browser
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
|
||
#### Syntax | ||
|
||
`mutation: remokeCustomerToken` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo. Also, as usual, use the same format shown in the Graphiql browser
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
|
||
#### Syntax | ||
|
||
`mutation: changeCustomerPassword` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the same format shown in the Graphiql browser
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
) { | ||
id | ||
firstname |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You won't get any truly helpful output fields, so pare the list down to just id and email
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to keep moving the goal posts, but let's change the format of the Syntax statements. Let's include the curly braces that wrap around a query/mutation and remove colons that aren't included in a call. Basically, it should look like an example stripped to the bone,
For queries use this format:
{customer: {Customer}}
For mutations:
mutation {createCustomer(input: CustomerInput!): CustomerOutput}
If at all possible, keep the syntax in one line, with complex structures being the exception
Approved, pending those changes
Hi @erikmarr, thank you for your contribution! |
This PR is a:
Summary
When this pull request is merged, it will fix issue #3338.
List all affected URLs