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

Commit 5ee5e8c

Browse files
authored
Merge pull request #7804 from andrewbess/style-fixes/fix-mutation-syntax
Fixed code style of the syntax for all "mutation" topic.
2 parents 5a58b8c + ecffbbe commit 5ee5e8c

38 files changed

+454
-163
lines changed

src/guides/v2.3/graphql/mutations/add-bundle-products.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@ Use the `addBundleProductsToCart` mutation to add bundle products to a specific
99

1010
## Syntax
1111

12-
`mutation: {addBundleProductsToCart(input: AddBundleProductsToCartInput): {AddBundleProductsToCartOutput}}`
12+
```graphql
13+
mutation {
14+
addBundleProductsToCart(
15+
input: AddBundleProductsToCartInput
16+
) {
17+
AddBundleProductsToCartOutput
18+
}
19+
}
20+
```
1321

1422
## Example usage
1523

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@ Use the `addConfigurableProductsToCart` mutation to add configurable products to
77

88
## Syntax
99

10-
`mutation: {addConfigurableProductsToCart(input: AddConfigurableProductsToCartInput) {AddConfigurableProductsToCartOutput}}`
10+
```graphql
11+
mutation {
12+
addConfigurableProductsToCart(
13+
input: AddConfigurableProductsToCartInput
14+
) {
15+
AddConfigurableProductsToCartOutput
16+
}
17+
}
18+
```
1119

1220
## Example usage
1321

src/guides/v2.3/graphql/mutations/add-downloadable-products.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ A downloadable product can be anything that you can deliver as a file, such as a
1010
## Syntax
1111

1212
```graphql
13-
mutation: {
14-
addDownloadableProductsToCart(
15-
input: AddDownloadableProductsToCartInput
16-
): {
17-
AddDownloadableProductsToCartOutput
18-
}
13+
mutation {
14+
addDownloadableProductsToCart(
15+
input: AddDownloadableProductsToCartInput
16+
) {
17+
AddDownloadableProductsToCartOutput
18+
}
1919
}
2020
```
2121

@@ -74,7 +74,7 @@ mutation {
7474

7575
**Response:**
7676

77-
```text
77+
```json
7878
{
7979
"data": {
8080
"addDownloadableProductsToCart": {
@@ -160,7 +160,7 @@ mutation {
160160

161161
**Response:**
162162

163-
```text
163+
```json
164164
{
165165
"data": {
166166
"addDownloadableProductsToCart": {

src/guides/v2.3/graphql/mutations/add-simple-products.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,15 @@ To add a simple or grouped product to a cart, you must provide the cart ID, the
1313

1414
## Syntax
1515

16-
`mutation: {addSimpleProductsToCart(input: AddSimpleProductsToCartInput): {AddSimpleProductsToCartOutput}}`
16+
```graphql
17+
mutation {
18+
addSimpleProductsToCart(
19+
input: AddSimpleProductsToCartInput
20+
) {
21+
AddSimpleProductsToCartOutput
22+
}
23+
}
24+
```
1725

1826
## Example usage
1927

@@ -124,7 +132,7 @@ mutation {
124132

125133
**Response:**
126134

127-
```text
135+
```json
128136
{
129137
"data": {
130138
"addSimpleProductsToCart": {

src/guides/v2.3/graphql/mutations/add-virtual-products.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,23 @@ The `addVirtualProductsToCart` mutation allows you to add multiple virtual produ
1111

1212
## Syntax
1313

14-
`mutation: {addVirtualProductsToCart(input: AddVirtualProductsToCartInput): {AddVirtualProductsToCartOutput}}`
14+
```graphql
15+
mutation {
16+
addVirtualProductsToCart(
17+
input: AddVirtualProductsToCartInput
18+
) {
19+
AddVirtualProductsToCartOutput
20+
}
21+
}
22+
```
1523

1624
## Example usage
1725

1826
The Luma sample data does not include any virtual products. The following example requires that you create a virtual product with the `sku` value of `Membership-Gold` with a price of $49.99.
1927

2028
**Request:**
2129

22-
```text
23-
30+
```graphql
2431
mutation {
2532
addVirtualProductsToCart(
2633
input: {

src/guides/v2.3/graphql/mutations/apply-coupon.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,23 @@ The `applyCouponToCart` mutation applies a pre-defined coupon code to the specif
99

1010
## Syntax
1111

12-
`mutation: {applyCouponToCart(input: ApplyCouponToCartInput) {ApplyCouponToCartOutput}}`
12+
```graphql
13+
mutation {
14+
applyCouponToCart(
15+
input: ApplyCouponToCartInput
16+
) {
17+
ApplyCouponToCartOutput
18+
}
19+
}
20+
```
1321

1422
## Example usage
1523

1624
The following example applies the coupon code `H2O` to the cart. For this coupon to be valid, the Affirm Water Bottle (`sku`: 24-UG06) must be in the cart.
1725

1826
**Request:**
1927

20-
``` text
28+
```graphql
2129
mutation {
2230
applyCouponToCart(
2331
input: {

src/guides/v2.3/graphql/mutations/apply-giftcard.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@ The `applyGiftCardToCart` mutation applies a pre-defined gift card code to the s
1010

1111
## Syntax
1212

13-
`mutation: applyGiftCardToCart(input: ApplyGiftCardToCartInput): ApplyGiftCardToCartOutput`
13+
```graphql
14+
mutation {
15+
applyGiftCardToCart(
16+
input: ApplyGiftCardToCartInput
17+
) {
18+
ApplyGiftCardToCartOutput
19+
}
20+
}
21+
```
1422

1523
## Example usage
1624

src/guides/v2.3/graphql/mutations/apply-store-credit.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@ If the amount of available store credit equals or exceeds the grand total of the
1515

1616
## Syntax
1717

18-
`mutation: {applyStoreCreditToCart(input: ApplyStoreCreditToCartInput): {ApplyStoreCreditToCartOutput}}`
18+
```graphql
19+
mutation {
20+
applyStoreCreditToCart(
21+
input: ApplyStoreCreditToCartInput
22+
) {
23+
ApplyStoreCreditToCartOutput
24+
}
25+
}
26+
```
1927

2028
## Example usage
2129

src/guides/v2.3/graphql/mutations/change-customer-password.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,16 @@ To return or modify information about a customer, Magento recommends you use cus
99

1010
## Syntax
1111

12-
`mutation: {changeCustomerPassword(currentPassword: String! newPassword: String!) {Customer}}`
12+
```graphql
13+
mutation {
14+
changeCustomerPassword(
15+
currentPassword: String!
16+
newPassword: String!
17+
) {
18+
Customer
19+
}
20+
}
21+
```
1322

1423
## Example usage
1524

src/guides/v2.3/graphql/mutations/create-braintree-client-token.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ The `createBraintreeClientToken` mutation creates the client token for Braintree
99

1010
## Syntax
1111

12-
`mutation: {createBraintreeClientToken}: String`
12+
```graphql
13+
mutation {
14+
createBraintreeClientToken {
15+
String
16+
}
17+
}
18+
```
1319

1420
## Example usage
1521

@@ -26,7 +32,7 @@ mutation {
2632
```json
2733
{
2834
"data": {
29-
"createBraintreeClientToken": "4JQaNVJokOpFxrykGVvYrjhiNv9qt31C"}
35+
"createBraintreeClientToken": "4JQaNVJokOpFxrykGVvYrjhiNv9qt31C"
3036
}
3137
}
3238
```

src/guides/v2.3/graphql/mutations/create-customer-address.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@ To return or modify information about a customer, Magento recommends you use cus
99

1010
## Syntax
1111

12-
`mutation: {createCustomerAddress(input: CustomerAddressInput!) {CustomerAddress}}`
12+
```graphql
13+
mutation {
14+
createCustomerAddress(
15+
input: CustomerAddressInput!
16+
) {
17+
CustomerAddress
18+
}
19+
}
20+
```
1321

1422
## Example usage
1523

src/guides/v2.3/graphql/mutations/create-customer.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@ To return or modify information about a customer, Magento recommends you use cus
99

1010
## Syntax
1111

12-
`mutation: {createCustomer(input: CustomerInput!) {CustomerOutput}}`
12+
```graphql
13+
mutation {
14+
createCustomer(
15+
input: CustomerInput!
16+
) {
17+
CustomerOutput
18+
}
19+
}
20+
```
1321

1422
## Example usage
1523

src/guides/v2.3/graphql/mutations/create-empty-cart.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ If you are creating a cart for a logged in customer, you must include the custom
1111

1212
## Syntax
1313

14-
`mutation: {createEmptyCart}: String`
14+
```graphql
15+
mutation {
16+
createEmptyCart {
17+
String
18+
}
19+
}
20+
```
1521

1622
## Example usage
1723

@@ -32,7 +38,7 @@ The response is the cart ID, which is sometimes called the quote ID. The remaini
3238
```json
3339
{
3440
"data": {
35-
"createEmptyCart": "4JQaNVJokOpFxrykGVvYrjhiNv9qt31C"}
41+
"createEmptyCart": "4JQaNVJokOpFxrykGVvYrjhiNv9qt31C"
3642
}
3743
}
3844
```
@@ -43,10 +49,13 @@ You can also create an empty cart with a specified `cart_id`.
4349

4450
**Request:**
4551

46-
``` text
52+
```graphql
4753
mutation {
48-
createEmptyCart(input:
49-
{ cart_id: "x2345678901234567890123456789012"})
54+
createEmptyCart(
55+
input: {
56+
cart_id: "x2345678901234567890123456789012"
57+
}
58+
)
5059
}
5160
```
5261

src/guides/v2.3/graphql/mutations/create-payflow-pro-token.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@ See [Paypal Payflow Pro payment method]({{page.baseurl}}/graphql/payment-methods
99

1010
## Syntax
1111

12-
`createPayflowProToken(input: PayflowProTokenInput): CreatePayflowProTokenOutput`
12+
```graphql
13+
mutation {
14+
createPayflowProToken(
15+
input: PayflowProTokenInput
16+
) {
17+
CreatePayflowProTokenOutput
18+
}
19+
}
20+
```
1321

1422
## Example usage
1523

src/guides/v2.3/graphql/mutations/create-paypal-express-token.md

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,39 @@ The input includes the cart ID, the payment method code, and a set of URLs that
1313

1414
## Syntax
1515

16-
`mutation: {createPaypalExpressToken(input: PaypalExpressTokenInput!): {PaypalExpressTokenOutput}}`
16+
```graphql
17+
mutation {
18+
createPaypalExpressToken(
19+
input: PaypalExpressTokenInput!
20+
) {
21+
PaypalExpressTokenOutput
22+
}
23+
}
24+
```
1725

1826
## Example usage
1927

2028
**Request:**
2129

2230
```graphql
2331
mutation {
24-
createPaypalExpressToken(
25-
input: {
26-
cart_id: "rMQdWEecBZr4SVWZwj2AF6y0dNCKQ8uH"
27-
code: "paypal_express"
28-
express_button: true
29-
urls: {
30-
return_url: "paypal/action/return.html"
31-
cancel_url: "paypal/action/cancel.html"
32-
}
33-
}
34-
)
35-
{
36-
token
37-
paypal_urls{
38-
start
39-
edit
40-
}
32+
createPaypalExpressToken(
33+
input: {
34+
cart_id: "rMQdWEecBZr4SVWZwj2AF6y0dNCKQ8uH"
35+
code: "paypal_express"
36+
express_button: true
37+
urls: {
38+
return_url: "paypal/action/return.html"
39+
cancel_url: "paypal/action/cancel.html"
40+
}
4141
}
42+
) {
43+
token
44+
paypal_urls {
45+
start
46+
edit
47+
}
48+
}
4249
}
4350
```
4451

@@ -48,9 +55,9 @@ mutation {
4855
{
4956
"data": {
5057
"createPaypalExpressToken": {
51-
"token": "<PayPal_Token>"
58+
"token": "<PayPal_Token>",
5259
"paypal_urls": {
53-
"start": "https://www.sandbox.paypal.com/checkoutnow?token=<PayPal_Token>"
60+
"start": "https://www.sandbox.paypal.com/checkoutnow?token=<PayPal_Token>",
5461
"edit": "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&useraction=continue&token=<PayPal_Token>"
5562
}
5663
}

0 commit comments

Comments
 (0)