Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Updating customer endpoint topic with mutations #3818

Merged
merged 6 commits into from
Mar 1, 2019

Conversation

erikmarr
Copy link
Contributor

@erikmarr erikmarr commented Feb 25, 2019

This PR is a:

  • New topic
  • Content update
  • Content fix or rewrite
  • Bug fix or improvement

Summary

When this pull request is merged, it will fix issue #3338.

List all affected URLs

@erikmarr erikmarr self-assigned this Feb 25, 2019
@erikmarr erikmarr requested a review from keharper February 25, 2019 15:30
@erikmarr
Copy link
Contributor Author

@keharper I created a new PR to target the 2.3.1 integration branch. This PR replaces the following PR which I will close after this review:
#3740

@erikmarr erikmarr added In progress Technical Updates to the code or processes that alter the technical content of the doc Community Docs impacted by community code contribution xx2.3.1 Magento 2.3.1 changes labels Feb 25, 2019

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.
Copy link
Contributor

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.

Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`email` | String | The customer's email address. Required
`email` | String | The customer's email address.

Copy link
Contributor Author

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.
Copy link
Contributor

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. )

Copy link
Contributor Author

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
Copy link
Contributor

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)

Copy link
Contributor Author

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.
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


#### Syntax

`mutation: generateCustomerToken`
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


#### Syntax

`mutation: remokeCustomerToken`
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


#### Syntax

`mutation: changeCustomerPassword`
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

) {
id
email
firstname
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Contributor

@keharper keharper left a 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

@erikmarr erikmarr merged commit ca6727f into 2.3.1-integration Mar 1, 2019
@ghost
Copy link

ghost commented Mar 1, 2019

Hi @erikmarr, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@erikmarr erikmarr deleted the em_magento-graphqlCustomer branch March 5, 2019 16:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Community Docs impacted by community code contribution Technical Updates to the code or processes that alter the technical content of the doc xx2.3.1 Magento 2.3.1 changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants