-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Updating Quote Endpoint with Query and Mutations #3838
Conversation
@keharper here's a build for your review: |
|
||
### Syntax | ||
|
||
`cart: Cart` |
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 syntax displayed in the Graphiql browser
cart(cart_id: String!): Cart
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
`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 |
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 CartAddress
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
`shipping_addresses` | [CartAddress] | Contains one or more shipping addresses | ||
|
||
### Cart address attributes {#cartAddressAttributes} | ||
The cart address object can contain the following attributes: |
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.
List the object name.
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
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`address_type` | [AddressTypeEnum] | Specifies if the type of address is shipping or billing |
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.
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.
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.
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: |
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.
Include the object name
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
|
||
You can set the billing and shipping addresses on a cart and specify shipping methods. | ||
|
||
### Set billing address on cart attributes |
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.
### Set billing address on cart attributes | |
### Set the billing address on cart attributes |
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
`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} |
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.
### Set billing address input attributes {#billingAddressInput} | |
### Set the billing address input attributes {#billingAddressInput} |
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
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: |
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.
State the name of the object
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
`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: |
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.
State the nsme of the object
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
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: |
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.
State the nsme of the object
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.
entered Kevin's edits
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.
There's a broken link that has to be fixed. Send me the link to an updated build.
} | ||
} | ||
``` | ||
<!-- |
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.
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.
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
postcode: "887766" | ||
country_code: "US" | ||
telephone: "88776655" | ||
save_in_address_book: false |
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.
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.
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.
Initial cap'd value.
`street` | [String] | The street for the billing address | ||
`telephone` | String | The telephone number for the billing address | ||
|
||
### Set billing address on cart |
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.
### Set billing address on cart | |
### Set the billing address on a cart |
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
cart_id: "4JQaNVJokOpFxrykGVvYrjhiNv9qt31C" | ||
billing_address: { | ||
address: { | ||
firstname: "test 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.
Make the address look realistic
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
} | ||
``` | ||
|
||
### Set shipping address on cart |
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.
### Set shipping address on cart | |
### Set the shipping address on cart |
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.
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} |
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 heading should appear in the right nav
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 text
} | ||
} | ||
``` | ||
|
||
### Add and remove coupons from a cart |
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.
Move the coupons mutations to the bottom. They won't be used as frequently as the others.
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.
moved
} | ||
``` | ||
|
||
### Adding products to cart |
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.
### Adding products to cart | |
### Adding simple products to a cart |
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
Hi @erikmarr, thank you for your contribution! |
@erikmarr |
This PR is a:
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