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

Fixed code style of the syntax for all "mutation" topic. #7804

Merged
merged 2 commits into from
Sep 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/guides/v2.3/graphql/mutations/add-bundle-products.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ Use the `addBundleProductsToCart` mutation to add bundle products to a specific

## Syntax

`mutation: {addBundleProductsToCart(input: AddBundleProductsToCartInput): {AddBundleProductsToCartOutput}}`
```graphql
mutation {
addBundleProductsToCart(
input: AddBundleProductsToCartInput
) {
AddBundleProductsToCartOutput
}
}
```

## Example usage

Expand Down
10 changes: 9 additions & 1 deletion src/guides/v2.3/graphql/mutations/add-configurable-products.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ Use the `addConfigurableProductsToCart` mutation to add configurable products to

## Syntax

`mutation: {addConfigurableProductsToCart(input: AddConfigurableProductsToCartInput) {AddConfigurableProductsToCartOutput}}`
```graphql
mutation {
addConfigurableProductsToCart(
input: AddConfigurableProductsToCartInput
) {
AddConfigurableProductsToCartOutput
}
}
```

## Example usage

Expand Down
16 changes: 8 additions & 8 deletions src/guides/v2.3/graphql/mutations/add-downloadable-products.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ A downloadable product can be anything that you can deliver as a file, such as a
## Syntax

```graphql
mutation: {
addDownloadableProductsToCart(
input: AddDownloadableProductsToCartInput
): {
AddDownloadableProductsToCartOutput
}
mutation {
addDownloadableProductsToCart(
input: AddDownloadableProductsToCartInput
) {
AddDownloadableProductsToCartOutput
}
}
```

Expand Down Expand Up @@ -74,7 +74,7 @@ mutation {

**Response:**

```text
```json
{
"data": {
"addDownloadableProductsToCart": {
Expand Down Expand Up @@ -160,7 +160,7 @@ mutation {

**Response:**

```text
```json
{
"data": {
"addDownloadableProductsToCart": {
Expand Down
12 changes: 10 additions & 2 deletions src/guides/v2.3/graphql/mutations/add-simple-products.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@ To add a simple or grouped product to a cart, you must provide the cart ID, the

## Syntax

`mutation: {addSimpleProductsToCart(input: AddSimpleProductsToCartInput): {AddSimpleProductsToCartOutput}}`
```graphql
mutation {
addSimpleProductsToCart(
input: AddSimpleProductsToCartInput
) {
AddSimpleProductsToCartOutput
}
}
```

## Example usage

Expand Down Expand Up @@ -124,7 +132,7 @@ mutation {

**Response:**

```text
```json
{
"data": {
"addSimpleProductsToCart": {
Expand Down
13 changes: 10 additions & 3 deletions src/guides/v2.3/graphql/mutations/add-virtual-products.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,23 @@ The `addVirtualProductsToCart` mutation allows you to add multiple virtual produ

## Syntax

`mutation: {addVirtualProductsToCart(input: AddVirtualProductsToCartInput): {AddVirtualProductsToCartOutput}}`
```graphql
mutation {
addVirtualProductsToCart(
input: AddVirtualProductsToCartInput
) {
AddVirtualProductsToCartOutput
}
}
```

## Example usage

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.

**Request:**

```text

```graphql
mutation {
addVirtualProductsToCart(
input: {
Expand Down
12 changes: 10 additions & 2 deletions src/guides/v2.3/graphql/mutations/apply-coupon.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,23 @@ The `applyCouponToCart` mutation applies a pre-defined coupon code to the specif

## Syntax

`mutation: {applyCouponToCart(input: ApplyCouponToCartInput) {ApplyCouponToCartOutput}}`
```graphql
mutation {
applyCouponToCart(
input: ApplyCouponToCartInput
) {
ApplyCouponToCartOutput
}
}
```

## Example usage

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.

**Request:**

``` text
```graphql
mutation {
applyCouponToCart(
input: {
Expand Down
10 changes: 9 additions & 1 deletion src/guides/v2.3/graphql/mutations/apply-giftcard.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ The `applyGiftCardToCart` mutation applies a pre-defined gift card code to the s

## Syntax

`mutation: applyGiftCardToCart(input: ApplyGiftCardToCartInput): ApplyGiftCardToCartOutput`
```graphql
mutation {
applyGiftCardToCart(
input: ApplyGiftCardToCartInput
) {
ApplyGiftCardToCartOutput
}
}
```

## Example usage

Expand Down
10 changes: 9 additions & 1 deletion src/guides/v2.3/graphql/mutations/apply-store-credit.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ If the amount of available store credit equals or exceeds the grand total of the

## Syntax

`mutation: {applyStoreCreditToCart(input: ApplyStoreCreditToCartInput): {ApplyStoreCreditToCartOutput}}`
```graphql
mutation {
applyStoreCreditToCart(
input: ApplyStoreCreditToCartInput
) {
ApplyStoreCreditToCartOutput
}
}
```

## Example usage

Expand Down
11 changes: 10 additions & 1 deletion src/guides/v2.3/graphql/mutations/change-customer-password.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,16 @@ To return or modify information about a customer, Magento recommends you use cus

## Syntax

`mutation: {changeCustomerPassword(currentPassword: String! newPassword: String!) {Customer}}`
```graphql
mutation {
changeCustomerPassword(
currentPassword: String!
newPassword: String!
) {
Customer
}
}
```

## Example usage

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ The `createBraintreeClientToken` mutation creates the client token for Braintree

## Syntax

`mutation: {createBraintreeClientToken}: String`
```graphql
mutation {
createBraintreeClientToken {
String
}
}
```

## Example usage

Expand All @@ -26,7 +32,7 @@ mutation {
```json
{
"data": {
"createBraintreeClientToken": "4JQaNVJokOpFxrykGVvYrjhiNv9qt31C"}
"createBraintreeClientToken": "4JQaNVJokOpFxrykGVvYrjhiNv9qt31C"
}
}
```
Expand Down
10 changes: 9 additions & 1 deletion src/guides/v2.3/graphql/mutations/create-customer-address.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ To return or modify information about a customer, Magento recommends you use cus

## Syntax

`mutation: {createCustomerAddress(input: CustomerAddressInput!) {CustomerAddress}}`
```graphql
mutation {
createCustomerAddress(
input: CustomerAddressInput!
) {
CustomerAddress
}
}
```

## Example usage

Expand Down
10 changes: 9 additions & 1 deletion src/guides/v2.3/graphql/mutations/create-customer.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ To return or modify information about a customer, Magento recommends you use cus

## Syntax

`mutation: {createCustomer(input: CustomerInput!) {CustomerOutput}}`
```graphql
mutation {
createCustomer(
input: CustomerInput!
) {
CustomerOutput
}
}
```

## Example usage

Expand Down
19 changes: 14 additions & 5 deletions src/guides/v2.3/graphql/mutations/create-empty-cart.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ If you are creating a cart for a logged in customer, you must include the custom

## Syntax

`mutation: {createEmptyCart}: String`
```graphql
mutation {
createEmptyCart {
String
}
}
```

## Example usage

Expand All @@ -32,7 +38,7 @@ The response is the cart ID, which is sometimes called the quote ID. The remaini
```json
{
"data": {
"createEmptyCart": "4JQaNVJokOpFxrykGVvYrjhiNv9qt31C"}
"createEmptyCart": "4JQaNVJokOpFxrykGVvYrjhiNv9qt31C"
}
}
```
Expand All @@ -43,10 +49,13 @@ You can also create an empty cart with a specified `cart_id`.

**Request:**

``` text
```graphql
mutation {
createEmptyCart(input:
{ cart_id: "x2345678901234567890123456789012"})
createEmptyCart(
input: {
cart_id: "x2345678901234567890123456789012"
}
)
}
```

Expand Down
10 changes: 9 additions & 1 deletion src/guides/v2.3/graphql/mutations/create-payflow-pro-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ See [Paypal Payflow Pro payment method]({{page.baseurl}}/graphql/payment-methods

## Syntax

`createPayflowProToken(input: PayflowProTokenInput): CreatePayflowProTokenOutput`
```graphql
mutation {
createPayflowProToken(
input: PayflowProTokenInput
) {
CreatePayflowProTokenOutput
}
}
```

## Example usage

Expand Down
47 changes: 27 additions & 20 deletions src/guides/v2.3/graphql/mutations/create-paypal-express-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,39 @@ The input includes the cart ID, the payment method code, and a set of URLs that

## Syntax

`mutation: {createPaypalExpressToken(input: PaypalExpressTokenInput!): {PaypalExpressTokenOutput}}`
```graphql
mutation {
createPaypalExpressToken(
input: PaypalExpressTokenInput!
) {
PaypalExpressTokenOutput
}
}
```

## Example usage

**Request:**

```graphql
mutation {
createPaypalExpressToken(
input: {
cart_id: "rMQdWEecBZr4SVWZwj2AF6y0dNCKQ8uH"
code: "paypal_express"
express_button: true
urls: {
return_url: "paypal/action/return.html"
cancel_url: "paypal/action/cancel.html"
}
}
)
{
token
paypal_urls{
start
edit
}
createPaypalExpressToken(
input: {
cart_id: "rMQdWEecBZr4SVWZwj2AF6y0dNCKQ8uH"
code: "paypal_express"
express_button: true
urls: {
return_url: "paypal/action/return.html"
cancel_url: "paypal/action/cancel.html"
}
}
) {
token
paypal_urls {
start
edit
}
}
}
```

Expand All @@ -48,9 +55,9 @@ mutation {
{
"data": {
"createPaypalExpressToken": {
"token": "<PayPal_Token>"
"token": "<PayPal_Token>",
"paypal_urls": {
"start": "https://www.sandbox.paypal.com/checkoutnow?token=<PayPal_Token>"
"start": "https://www.sandbox.paypal.com/checkoutnow?token=<PayPal_Token>",
"edit": "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&useraction=continue&token=<PayPal_Token>"
}
}
Expand Down
Loading