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

Commit 4664488

Browse files
authored
GraphQL: Migrate Quote endpoint topics (#5284)
* first draft * add redirect and related topics * review comments * fix broken link
1 parent 68fa9a7 commit 4664488

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+285
-253
lines changed

_data/toc/graphql.yml

Lines changed: 51 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ pages:
4747

4848
- label: Queries
4949
children:
50+
- label: cart query
51+
url: /graphql/queries/cart.html
52+
5053
- label: category query
5154
url: /graphql/queries/category.html
5255

@@ -89,6 +92,9 @@ pages:
8992
- label: getPayflowLinkToken query
9093
url: /graphql/queries/get-payflow-link-token.html
9194

95+
- label: giftCardAccount query
96+
url: /graphql/queries/giftcard-account.html
97+
9298
- label: isEmailAvailable query
9399
url: /graphql/queries/is-email-available.html
94100

@@ -109,6 +115,18 @@ pages:
109115
- label: addConfigurableProductsToCart mutation
110116
url: /graphql/mutations/add-configurable-products.html
111117

118+
- label: addSimpleProductsToCart mutation
119+
url: /graphql/mutations/add-simple-products.html
120+
121+
- label: addVirtualProductsToCart mutation
122+
url: /graphql/mutations/add-virtual-products.html
123+
124+
- label: applyGiftCardToCart mutation
125+
url: /graphql/mutations/apply-giftcard.html
126+
127+
- label: applyCouponToCart mutation
128+
url: /graphql/mutations/apply-coupon.html
129+
112130
- label: applyStoreCreditToCart mutation
113131
url: /graphql/mutations/apply-store-credit.html
114132

@@ -121,6 +139,9 @@ pages:
121139
- label: createCustomer mutation
122140
url: /graphql/mutations/create-customer.html
123141

142+
- label: createEmptyCart mutation
143+
url: /graphql/mutations/create-empty-cart.html
144+
124145
- label: createPayflowProToken mutation
125146
url: /graphql/mutations/create-payflow-pro-token.html
126147

@@ -136,21 +157,51 @@ pages:
136157
- label: handlePayflowProResponse mutation
137158
url: /graphql/mutations/handle-payflow-pro-response.html
138159

160+
- label: placeOrder mutation
161+
url: /graphql/mutations/place-order.html
162+
139163
- label: redeemGiftCardBalanceAsStoreCredit mutation
140164
url: /graphql/mutations/redeem-giftcard-balance.html
141165

166+
- label: removeCouponFromCart mutation
167+
url: /graphql/mutations/remove-coupon.html
168+
142169
- label: removeGiftCardFromCart mutation
143170
url: /graphql/mutations/remove-giftcard.html
144171

172+
- label: removeItemFromCart mutation
173+
url: /graphql/mutations/remove-item.html
174+
145175
- label: removeStoreCreditFromCart mutation
146176
url: /graphql/mutations/remove-store-credit.html
147177

148178
- label: revokeCustomerToken mutation
149179
url: /graphql/mutations/revoke-customer-token.html
150180

181+
- label: setBillingAddressesOnCart mutation
182+
url: /graphql/mutations/set-billing-address.html
183+
184+
- label: setGuestEmailOnCart mutation
185+
url: /graphql/mutations/set-guest-email.html
186+
187+
- label: setPaymentMethodOnCart mutation
188+
url: /graphql/mutations/set-payment-method.html
189+
190+
- label: setPaymentMethodAndPlaceOrder mutation
191+
url: /graphql/mutations/set-payment-place-order.html
192+
193+
- label: setShippingAddressesOnCart mutation
194+
url: /graphql/mutations/set-shipping-address.html
195+
196+
- label: setShippingMethodsOnCart mutation
197+
url: /graphql/mutations/set-shipping-method.html
198+
151199
- label: updateCustomerAddress mutation
152200
url: /graphql/mutations/update-customer-address.html
153201

202+
- label: updateCartItems mutation
203+
url: /graphql/mutations/update-cart-items.html
204+
154205
- label: updateCustomer mutation
155206
url: /graphql/mutations/update-customer.html
156207

@@ -177,60 +228,6 @@ pages:
177228
- label: GroupedProduct data types
178229
url: /graphql/product/grouped-product.html
179230

180-
- label: Reference
181-
children:
182-
- label: Quote endpoint (cart query)
183-
url: /graphql/reference/quote.html
184-
children:
185-
186-
- label: addSimpleProductsToCart mutation
187-
url: /graphql/reference/quote-add-simple-products.html
188-
189-
- label: addVirtualProductsToCart mutation
190-
url: /graphql/reference/quote-add-virtual-products.html
191-
192-
- label: applyCouponToCart mutation
193-
url: /graphql/reference/quote-apply-coupon.html
194-
195-
- label: applyGiftCardToCart mutation
196-
url: /graphql/reference/quote-apply-giftcard.html
197-
198-
- label: createEmptyCart mutation
199-
url: /graphql/reference/quote-create-cart.html
200-
201-
- label: giftCardAccount query
202-
url: /graphql/reference/quote-giftcard-account.html
203-
204-
- label: placeOrder mutation
205-
url: /graphql/reference/quote-place-order.html
206-
207-
- label: removeCouponFromCart mutation
208-
url: /graphql/reference/quote-remove-coupon.html
209-
210-
- label: removeItemFromCart mutation
211-
url: /graphql/reference/quote-remove-item.html
212-
213-
- label: setBillingAddressesOnCart mutation
214-
url: /graphql/reference/quote-set-billing-address.html
215-
216-
- label: setGuestEmailOnCart mutation
217-
url: /graphql/reference/quote-set-guest-email.html
218-
219-
- label: setPaymentMethodOnCart mutation
220-
url: /graphql/reference/quote-payment-method.html
221-
222-
- label: setPaymentMethodAndPlaceOrder mutation
223-
url: /graphql/reference/quote-set-payment-place-order.html
224-
225-
- label: setShippingAddressesOnCart mutation
226-
url: /graphql/reference/quote-set-shipping-address.html
227-
228-
- label: setShippingMethodsOnCart mutation
229-
url: /graphql/reference/quote-shipping-method.html
230-
231-
- label: updateCartItems mutation
232-
url: /graphql/reference/quote-update-cart-items.html
233-
234231
- label: Payment methods
235232
children:
236233

_data/whats-new.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -451,8 +451,8 @@ entries:
451451
type: Major update
452452
date: June 22, 2019
453453
link: https://github.com/magento/devdocs/pull/4556
454-
- description: The [GraphQL quote endpoint](https://devdocs.magento.com/guides/v2.3/graphql/reference/quote.html)
455-
adds numerous mutations for 2.3.2. Each mutation is documented separately. The
454+
- description: The [GraphQL cart query](https://devdocs.magento.com/guides/v2.3/graphql/queries/cart.html)
455+
now has numerous related mutations for 2.3.2. Each mutation is documented separately. The
456456
[GraphQL release notes](https://devdocs.magento.com/guides/v2.3/graphql/release-notes.html)
457457
lists these new mutations.
458458
versions: 2.3.2
@@ -1051,7 +1051,7 @@ entries:
10511051
type: Major update
10521052
date: March 26, 2019
10531053
link: https://github.com/magento/devdocs/pull/3859
1054-
- description: Added queries and mutations to the [quote endpoint](https://devdocs.magento.com/guides/v2.3/graphql/reference/quote.html)
1054+
- description: Added the [`cart` query](https://devdocs.magento.com/guides/v2.3/graphql/queries/cart.html) and several mutations.
10551055
versions: 2.3.1
10561056
type: Major update
10571057
date: March 26, 2019
@@ -1609,7 +1609,7 @@ entries:
16091609
versions: 2.1.x, 2.2.x, 2.3.x
16101610
type: Major update
16111611
date: November 21 2018
1612-
- description: Added the [GraphQL quote endpoint](https://devdocs.magento.com/guides/v2.3/graphql/reference/quote.html)
1612+
- description: Added the [GraphQL cart query](https://devdocs.magento.com/guides/v2.3/graphql/queries/cart.html)
16131613
topic
16141614
versions: 2.3.x
16151615
type: New topic

_includes/graphql/cart-object.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ Attribute | Data Type | Description
1111
`selected_payment_method` | [SelectedPaymentMethod][SelectedPaymentMethod] | Selected payment method
1212
`shipping_addresses` | [ShippingCartAddress][ShippingCartAddress] | Contains one or more shipping addresses
1313

14-
[AppliedCoupon]: {{page.baseurl}}/graphql/reference/quote.html#AppliedCoupon
15-
[AppliedGiftCard]: {{page.baseurl}}/graphql/reference/quote.html#AppliedGiftCard
16-
[AppliedStoreCredit]: {{page.baseurl}}/graphql/reference/quote.html#AppliedStoreCredit
17-
[AvailablePaymentMethod]: {{page.baseurl}}/graphql/reference/quote.html#AvailablePaymentMethod
18-
[BillingCartAddress]: {{page.baseurl}}/graphql/reference/quote.html#BillingCartAddress
19-
[CartItemInterface]: {{page.baseurl}}/graphql/reference/quote.html#CartItemInterface
20-
[CartPrices]: {{page.baseurl}}/graphql/reference/quote.html#CartPrices
21-
[SelectedPaymentMethod]: {{page.baseurl}}/graphql/reference/quote.html#SelectedPaymentMethod
22-
[ShippingCartAddress]: {{page.baseurl}}/graphql/reference/quote.html#ShippingCartAddress
14+
[AppliedCoupon]: {{page.baseurl}}/graphql/queries/cart.html#AppliedCoupon
15+
[AppliedGiftCard]: {{page.baseurl}}/graphql/queries/cart.html#AppliedGiftCard
16+
[AppliedStoreCredit]: {{page.baseurl}}/graphql/queries/cart.html#AppliedStoreCredit
17+
[AvailablePaymentMethod]: {{page.baseurl}}/graphql/queries/cart.html#AvailablePaymentMethod
18+
[BillingCartAddress]: {{page.baseurl}}/graphql/queries/cart.html#BillingCartAddress
19+
[CartItemInterface]: {{page.baseurl}}/graphql/queries/cart.html#CartItemInterface
20+
[CartPrices]: {{page.baseurl}}/graphql/queries/cart.html#CartPrices
21+
[SelectedPaymentMethod]: {{page.baseurl}}/graphql/queries/cart.html#SelectedPaymentMethod
22+
[ShippingCartAddress]: {{page.baseurl}}/graphql/queries/cart.html#ShippingCartAddress
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
1. The PWA client uses the [`setPaymentMethodOnCart`]({{page.baseurl}}/graphql/reference/quote-payment-method.html) mutation to set the payment method.
1+
1. The PWA client uses the [`setPaymentMethodOnCart`]({{page.baseurl}}/graphql/mutations/set-payment-method.html) mutation to set the payment method.
22

33
1. The mutation returns a `Cart` object.
44

5-
1. The client runs the [`placeOrder`]({{page.baseurl}}/graphql/reference/quote-place-order.html) mutation, which creates an order in Magento and begins the authorization process.
5+
1. The client runs the [`placeOrder`]({{page.baseurl}}/graphql/mutations/place-order.html) mutation, which creates an order in Magento and begins the authorization process.
66

7-
2. Magento sends information about the order to PayPal and requests a secure URL that the PWA client will later use to connect to PayPal.
7+
1. Magento sends information about the order to PayPal and requests a secure URL that the PWA client will later use to connect to PayPal.
88

9-
3. PayPal's response includes the secure URL.
9+
1. PayPal's response includes the secure URL.
1010

11-
4. The `placeOrder` mutation returns an order ID. The order has the status `payment pending`.
11+
1. The `placeOrder` mutation returns an order ID. The order has the status `payment pending`.
1212

13-
5. The client runs the [`getHostedProUrl`]({{page.baseurl}}/graphql/queries/get-hosted-pro-url.html) query to retrieve the secure URL.
13+
1. The client runs the [`getHostedProUrl`]({{page.baseurl}}/graphql/queries/get-hosted-pro-url.html) query to retrieve the secure URL.
1414

15-
6. Magento returns the secure URL in the `secure_form_url` attribute.
15+
1. Magento returns the secure URL in the `secure_form_url` attribute.
1616

17-
7. The PWA client displays a payment form in an iframe rendered from the secure URL. When the customer completes the form, the client sends the payment information directly to the PayPal gateway, bypassing the Magento server.
17+
1. The PWA client displays a payment form in an iframe rendered from the secure URL. When the customer completes the form, the client sends the payment information directly to the PayPal gateway, bypassing the Magento server.
1818

19-
8. After PayPal processes the payment, the gateway runs a silent post request against the Magento server. As a result, Magento sets the order status to processing, and the order is ready to be invoiced.
19+
1. After PayPal processes the payment, the gateway runs a silent post request against the Magento server. As a result, Magento sets the order status to processing, and the order is ready to be invoiced.
2020

21-
9. The PayPal gateway returns control of the customer's browser to the client.
21+
1. The PayPal gateway returns control of the customer's browser to the client.

_includes/graphql/payment-methods/payflow-link-workflow.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
1. The PWA client uses the [`setPaymentMethodOnCart`]({{page.baseurl}}/graphql/reference/quote-payment-method.html) mutation to set the payment method.
1+
1. The PWA client uses the [`setPaymentMethodOnCart`]({{page.baseurl}}/graphql/mutations/set-payment-method.html) mutation to set the payment method.
22

33
1. The mutation returns a `Cart` object.
44

5-
1. The client runs the [`placeOrder`]({{page.baseurl}}/graphql/reference/quote-place-order.html) mutation, which creates an order in Magento and begins the authorization process.
5+
1. The client runs the [`placeOrder`]({{page.baseurl}}/graphql/mutations/place-order.html) mutation, which creates an order in Magento and begins the authorization process.
66

77
1. Magento requests a secure token from the Paypal gateway.
88

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
1. On the checkout page, the customer selects **Credit Card** as the payment method and enters the credit card information as well as the billing and shipping addresses. When the customer clicks **Place Order**, the PWA client uses the [`setPaymentMethodOnCart`]({{page.baseurl}}/graphql/reference/quote-payment-method.html) mutation to set the payment method to `payflowpro`.
1+
1. On the checkout page, the customer selects **Credit Card** as the payment method and enters the credit card information as well as the billing and shipping addresses. When the customer clicks **Place Order**, the PWA client uses the [`setPaymentMethodOnCart`]({{page.baseurl}}/graphql/mutations/set-payment-method.html) mutation to set the payment method to `payflowpro`.
22

3-
2. The mutation returns a `Cart` object.
3+
1. The mutation returns a `Cart` object.
44

5-
3. The client runs the [`createPayflowProToken`]({{page.baseurl}}/graphql/mutations/create-payflow-pro-token.html) mutation to initiate a transaction.
5+
1. The client runs the [`createPayflowProToken`]({{page.baseurl}}/graphql/mutations/create-payflow-pro-token.html) mutation to initiate a transaction.
66

7-
4. Magento requests a secure token from the PayPal gateway. The request also contains billing and shipping information, which Magento extracts from the `Cart` object.
7+
1. Magento requests a secure token from the PayPal gateway. The request also contains billing and shipping information, which Magento extracts from the `Cart` object.
88

9-
5. The gateway response includes a secure token, a secure token ID, and result codes and descriptions.
9+
1. The gateway response includes a secure token, a secure token ID, and result codes and descriptions.
1010

11-
6. Magento returns the secure token, a secure token ID, and result codes and descriptions in response to the `createPayflowProToken` mutation.
11+
1. Magento returns the secure token, a secure token ID, and result codes and descriptions in response to the `createPayflowProToken` mutation.
1212

13-
7. The client uses a hidden iframe to send a silent post request directly to the PayPal gateway for account verification. For live requests, send the silent post to `https://payflowlink.paypal.com`. Send test requests to `https://pilot-payflowlink.paypal.com`.
13+
1. The client uses a hidden iframe to send a silent post request directly to the PayPal gateway for account verification. For live requests, send the silent post to `https://payflowlink.paypal.com`. Send test requests to `https://pilot-payflowlink.paypal.com`.
1414

15-
8. The gateway responds directly to the client. The response contains a payload that includes secure token information and billing and shipping information.
15+
1. The gateway responds directly to the client. The response contains a payload that includes secure token information and billing and shipping information.
1616

17-
9. The client uses the [`handlePayflowProResponse`]({{page.baseurl}}/graphql/mutations/handle-payflow-pro-response.html) mutation to send the payload to Magento. Magento stores this information without modifying the cart.
17+
1. The client uses the [`handlePayflowProResponse`]({{page.baseurl}}/graphql/mutations/handle-payflow-pro-response.html) mutation to send the payload to Magento. Magento stores this information without modifying the cart.
1818

19-
10. The mutation returns a `Cart` object.
19+
1. The mutation returns a `Cart` object.
2020

21-
11. The client runs the [`placeOrder`]({{page.baseurl}}/graphql/reference/quote-place-order.html) mutation, which creates an order in Magento and begins the authorization process.
21+
1. The client runs the [`placeOrder`]({{page.baseurl}}/graphql/mutations/place-order.html) mutation, which creates an order in Magento and begins the authorization process.
2222

23-
12. Magento sends an authorization request to the gateway.
23+
1. Magento sends an authorization request to the gateway.
2424

25-
13. The gateway sends the response to Magento.
25+
1. The gateway sends the response to Magento.
2626

27-
14. Magento creates an order and sends an order ID in response to the `placeOrder` mutation.
27+
1. Magento creates an order and sends an order ID in response to the `placeOrder` mutation.

_includes/graphql/payment-methods/paypal-express-checkout-workflow.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010

1111
1. If the customer approves the payment, PayPal redirects the customer back to the payment confirmation page. The response includes the secure token and payer ID as GET parameters.
1212

13-
1. Set the payment method. The frontend runs the [`setPaymentMethodOnCart`]({{page.baseurl}}/graphql/reference/quote-payment-method.html) mutation. The payload includes the PayPal token, the payer ID, and the cart ID. The cart may have been updated since the token was requested, as shipping costs, taxes, and other adjustments might have been applied to the cart. Magento submits the updated cart to PayPal.
13+
1. Set the payment method. The frontend runs the [`setPaymentMethodOnCart`]({{page.baseurl}}/graphql/mutations/set-payment-method.html) mutation. The payload includes the PayPal token, the payer ID, and the cart ID. The cart may have been updated since the token was requested, as shipping costs, taxes, and other adjustments might have been applied to the cart. Magento submits the updated cart to PayPal.
1414

1515
1. Magento returns a `Cart` object.
1616

17-
1. Place the order with the [`placeOrder`]({{page.baseurl}}/graphql/reference/quote-place-order.html) mutation.
17+
1. Place the order with the [`placeOrder`]({{page.baseurl}}/graphql/mutations/place-order.html) mutation.
1818

1919
1. Magento sends the secure token, payer ID, and final cart information to PayPal.
2020

2121
1. PayPal captures the payment by transferring the funds from the customer account to the appropriate merchant account.
2222

23-
1. Magento creates an order, ready for fulfillment.
23+
1. Magento creates an order, ready for fulfillment.

guides/v2.3/graphql/mutations/add-configurable-products.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Use the `addConfigurableProductsToCart` mutation to add configurable products to
1111

1212
## Example usage
1313

14-
The following example adds two black Teton Pullover Hoodies size extra-small to the specified shopping cart. The `cart_id` used in this example was [generated]({{ page.baseurl }}/graphql/reference/quote-create-cart.html) by creating an empty cart.
14+
The following example adds two black Teton Pullover Hoodies size extra-small to the specified shopping cart. The `cart_id` used in this example was [generated]({{ page.baseurl }}/graphql/mutations/create-empty-cart.html) by creating an empty cart.
1515

1616
**Request**
1717

@@ -124,7 +124,7 @@ Attribute | Data Type | Description
124124

125125
{% include graphql/cart-object.md %}
126126

127-
[Cart query output]({{page.baseurl}}/graphql/reference/quote.html#cart-output) provides more information about the `Cart` object.
127+
[Cart query output]({{page.baseurl}}/graphql/queries/cart.html#cart-output) provides more information about the `Cart` object.
128128

129129
## Related topics
130130

0 commit comments

Comments
 (0)