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

Updating Quote Endpoint with Query and Mutations #3838

Merged
merged 6 commits into from
Mar 3, 2019

Conversation

erikmarr
Copy link
Contributor

@erikmarr erikmarr commented Feb 28, 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 #3337.

Additional information

List all affected URLs

whatsnew
Added queries and mutations to the quote endpoint

@erikmarr erikmarr requested a review from keharper February 28, 2019 17:52
@erikmarr erikmarr self-assigned this Feb 28, 2019
@erikmarr erikmarr added Major Update Significant original updates to existing content Community Docs impacted by community code contribution xx2.3.1 Magento 2.3.1 changes labels Feb 28, 2019
@erikmarr erikmarr changed the title updating with mutations Updating Quote Endpoint with Query and Mutations Feb 28, 2019
@erikmarr
Copy link
Contributor Author


### Syntax

`cart: Cart`
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 syntax displayed in the Graphiql browser

cart(cart_id: String!): Cart

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

`billing_address` | [CartAddress](#cartAddressAttributes) | Contains the billing address specified in the customer's cart
`cart_id` | String | The unique ID that identifies the customer's cart
`items` | [CartItemInterface](#cartItemsInterface) | Contains the items in the customer's cart
`shipping_addresses` | [CartAddress] | Contains one or more shipping addresses
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 CartAddress

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

`shipping_addresses` | [CartAddress] | Contains one or more shipping addresses

### Cart address attributes {#cartAddressAttributes}
The cart address object can contain the following attributes:
Copy link
Contributor

Choose a reason for hiding this comment

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

List the object name.

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


Attribute | Data Type | Description
--- | --- | ---
`address_type` | [AddressTypeEnum] | Specifies if the type of address is shipping or billing
Copy link
Contributor

Choose a reason for hiding this comment

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

The square brackets around a data type indicates an array, which means it can have multiple values or parts. This enumeration can have only 1 value, SHIPPING or BILLING.

So, remove the brackets. Since the enumeration values are defined in all caps, I'm inclined to say use the same case. However, if there are a lot of all uppercase enumerations, that's going to feel like too much shouting. Use your best judgment on that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

decided to go with all caps. I don't believe there are many enums so I don't anticipate this being an issue.

`telephone` | String | The telephone number for the shipping or billing address

### Cart item interface attributes {#cartItemsInterface}
The cart item interface object can contain the following attributes:
Copy link
Contributor

Choose a reason for hiding this comment

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

Include the object name

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


You can set the billing and shipping addresses on a cart and specify shipping methods.

### Set billing address on cart attributes
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
### Set billing address on cart attributes
### Set the billing address on cart attributes

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

`billing_address` | [BillingAddressInput](#billingAddressInput) | The list of items to add to the cart
`cart_id` | String | The unique ID that identifies the customer's cart

### Set billing address input attributes {#billingAddressInput}
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
### Set billing address input attributes {#billingAddressInput}
### Set the billing address input attributes {#billingAddressInput}

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

You can set the billing and shipping addresses on a cart and specify shipping methods.

### Set billing address on cart attributes
The Set billing address on cart object can contain the following attributes:
Copy link
Contributor

Choose a reason for hiding this comment

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

State the name of the object

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

`cart_id` | String | The unique ID that identifies the customer's cart

### Set billing address input attributes {#billingAddressInput}
The Set billing address input object can contain the following attributes:
Copy link
Contributor

Choose a reason for hiding this comment

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

State the nsme of the object

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

Adds simple items to a specific cart.

### Add simple products to cart attributes
The Add simple products to cart object can contain the following attributes:
Copy link
Contributor

Choose a reason for hiding this comment

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

State the nsme of the object

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 Author

@erikmarr erikmarr left a comment

Choose a reason for hiding this comment

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

entered Kevin's edits

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.

There's a broken link that has to be fixed. Send me the link to an updated build.

}
}
```
<!--
Copy link
Contributor

Choose a reason for hiding this comment

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

addConfigurableProductsToCart mutation is defined in the ConfigurableProducts module. Issue 3779 covers this mutation, so remove the commented-out text. Also delete the commented out text toward the top of the topic.

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

guides/v2.3/graphql/reference/quote.md Show resolved Hide resolved
postcode: "887766"
country_code: "US"
telephone: "88776655"
save_in_address_book: false
Copy link
Contributor

Choose a reason for hiding this comment

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

The description of this parameter says the boolean value is either True or False, with a capital letter. I don't know if it matters, but make them consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Initial cap'd value.

guides/v2.3/graphql/reference/quote.md Show resolved Hide resolved
`street` | [String] | The street for the billing address
`telephone` | String | The telephone number for the billing address

### Set billing address on cart
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
### Set billing address on cart
### Set the billing address on a cart

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

cart_id: "4JQaNVJokOpFxrykGVvYrjhiNv9qt31C"
billing_address: {
address: {
firstname: "test firstname"
Copy link
Contributor

Choose a reason for hiding this comment

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

Make the address look realistic

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

}
```

### Set shipping address on cart
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
### Set shipping address on cart
### Set the shipping address on cart

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.

Approved, pending changes.

@@ -137,6 +118,9 @@ The following returns information about a cart given a `cart_id`. Note that the

## Mutations

### Create an empty cart {#createEmptyCart}
{:.no_toc}
Copy link
Contributor

Choose a reason for hiding this comment

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

This heading should appear in the right nav

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 text

}
}
```

### Add and remove coupons from a cart
Copy link
Contributor

Choose a reason for hiding this comment

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

Move the coupons mutations to the bottom. They won't be used as frequently as the others.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved

}
```

### Adding products to cart
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
### Adding products to cart
### Adding simple products to a cart

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

@erikmarr erikmarr merged commit 475d8ec into 2.3.1-integration Mar 3, 2019
@ghost
Copy link

ghost commented Mar 3, 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-graphqlQuote2 branch March 5, 2019 16:49
@dshevtsov
Copy link
Collaborator

@erikmarr
There is missing whatsnew for the Major Update PR.

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 Major Update Significant original updates to existing content xx2.3.1 Magento 2.3.1 changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants