diff --git a/src/guides/v2.3/graphql/mutations/add-bundle-products.md b/src/guides/v2.3/graphql/mutations/add-bundle-products.md index b9de649a63e..1ffc7265f82 100644 --- a/src/guides/v2.3/graphql/mutations/add-bundle-products.md +++ b/src/guides/v2.3/graphql/mutations/add-bundle-products.md @@ -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 diff --git a/src/guides/v2.3/graphql/mutations/add-configurable-products.md b/src/guides/v2.3/graphql/mutations/add-configurable-products.md index d8a6fe7f369..326c09561b3 100644 --- a/src/guides/v2.3/graphql/mutations/add-configurable-products.md +++ b/src/guides/v2.3/graphql/mutations/add-configurable-products.md @@ -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 diff --git a/src/guides/v2.3/graphql/mutations/add-downloadable-products.md b/src/guides/v2.3/graphql/mutations/add-downloadable-products.md index 7162f5023ba..e230661c91f 100644 --- a/src/guides/v2.3/graphql/mutations/add-downloadable-products.md +++ b/src/guides/v2.3/graphql/mutations/add-downloadable-products.md @@ -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 + } } ``` @@ -74,7 +74,7 @@ mutation { **Response:** -```text +```json { "data": { "addDownloadableProductsToCart": { @@ -160,7 +160,7 @@ mutation { **Response:** -```text +```json { "data": { "addDownloadableProductsToCart": { diff --git a/src/guides/v2.3/graphql/mutations/add-simple-products.md b/src/guides/v2.3/graphql/mutations/add-simple-products.md index 81089ad5f4e..044dea34e0f 100644 --- a/src/guides/v2.3/graphql/mutations/add-simple-products.md +++ b/src/guides/v2.3/graphql/mutations/add-simple-products.md @@ -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 @@ -124,7 +132,7 @@ mutation { **Response:** -```text +```json { "data": { "addSimpleProductsToCart": { diff --git a/src/guides/v2.3/graphql/mutations/add-virtual-products.md b/src/guides/v2.3/graphql/mutations/add-virtual-products.md index b9d23c64345..1d9f074efc3 100644 --- a/src/guides/v2.3/graphql/mutations/add-virtual-products.md +++ b/src/guides/v2.3/graphql/mutations/add-virtual-products.md @@ -11,7 +11,15 @@ The `addVirtualProductsToCart` mutation allows you to add multiple virtual produ ## Syntax -`mutation: {addVirtualProductsToCart(input: AddVirtualProductsToCartInput): {AddVirtualProductsToCartOutput}}` +```graphql +mutation { + addVirtualProductsToCart( + input: AddVirtualProductsToCartInput + ) { + AddVirtualProductsToCartOutput + } +} +``` ## Example usage @@ -19,8 +27,7 @@ The Luma sample data does not include any virtual products. The following exampl **Request:** -```text - +```graphql mutation { addVirtualProductsToCart( input: { diff --git a/src/guides/v2.3/graphql/mutations/apply-coupon.md b/src/guides/v2.3/graphql/mutations/apply-coupon.md index 5c7a0a12b1c..eb2f2ff662c 100644 --- a/src/guides/v2.3/graphql/mutations/apply-coupon.md +++ b/src/guides/v2.3/graphql/mutations/apply-coupon.md @@ -9,7 +9,15 @@ 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 @@ -17,7 +25,7 @@ The following example applies the coupon code `H2O` to the cart. For this coupon **Request:** -``` text +```graphql mutation { applyCouponToCart( input: { diff --git a/src/guides/v2.3/graphql/mutations/apply-giftcard.md b/src/guides/v2.3/graphql/mutations/apply-giftcard.md index 8b862ef99f8..34b56fe0767 100644 --- a/src/guides/v2.3/graphql/mutations/apply-giftcard.md +++ b/src/guides/v2.3/graphql/mutations/apply-giftcard.md @@ -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 diff --git a/src/guides/v2.3/graphql/mutations/apply-store-credit.md b/src/guides/v2.3/graphql/mutations/apply-store-credit.md index 7bc102b7628..5b2645a56d0 100644 --- a/src/guides/v2.3/graphql/mutations/apply-store-credit.md +++ b/src/guides/v2.3/graphql/mutations/apply-store-credit.md @@ -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 diff --git a/src/guides/v2.3/graphql/mutations/change-customer-password.md b/src/guides/v2.3/graphql/mutations/change-customer-password.md index 6188bfe0d1d..d11627f5d9b 100644 --- a/src/guides/v2.3/graphql/mutations/change-customer-password.md +++ b/src/guides/v2.3/graphql/mutations/change-customer-password.md @@ -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 diff --git a/src/guides/v2.3/graphql/mutations/create-braintree-client-token.md b/src/guides/v2.3/graphql/mutations/create-braintree-client-token.md index 712acace62b..07b6fc38407 100644 --- a/src/guides/v2.3/graphql/mutations/create-braintree-client-token.md +++ b/src/guides/v2.3/graphql/mutations/create-braintree-client-token.md @@ -9,7 +9,13 @@ The `createBraintreeClientToken` mutation creates the client token for Braintree ## Syntax -`mutation: {createBraintreeClientToken}: String` +```graphql +mutation { + createBraintreeClientToken { + String + } +} +``` ## Example usage @@ -26,7 +32,7 @@ mutation { ```json { "data": { - "createBraintreeClientToken": "4JQaNVJokOpFxrykGVvYrjhiNv9qt31C"} + "createBraintreeClientToken": "4JQaNVJokOpFxrykGVvYrjhiNv9qt31C" } } ``` diff --git a/src/guides/v2.3/graphql/mutations/create-customer-address.md b/src/guides/v2.3/graphql/mutations/create-customer-address.md index 2551cb2820c..2837267a59d 100644 --- a/src/guides/v2.3/graphql/mutations/create-customer-address.md +++ b/src/guides/v2.3/graphql/mutations/create-customer-address.md @@ -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 diff --git a/src/guides/v2.3/graphql/mutations/create-customer.md b/src/guides/v2.3/graphql/mutations/create-customer.md index 8bb7aeacf76..a5ad0bbea5e 100644 --- a/src/guides/v2.3/graphql/mutations/create-customer.md +++ b/src/guides/v2.3/graphql/mutations/create-customer.md @@ -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 diff --git a/src/guides/v2.3/graphql/mutations/create-empty-cart.md b/src/guides/v2.3/graphql/mutations/create-empty-cart.md index 180647c0431..4f8bb49c3eb 100644 --- a/src/guides/v2.3/graphql/mutations/create-empty-cart.md +++ b/src/guides/v2.3/graphql/mutations/create-empty-cart.md @@ -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 @@ -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" } } ``` @@ -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" + } + ) } ``` diff --git a/src/guides/v2.3/graphql/mutations/create-payflow-pro-token.md b/src/guides/v2.3/graphql/mutations/create-payflow-pro-token.md index 08880f815b5..e5d812b1afb 100644 --- a/src/guides/v2.3/graphql/mutations/create-payflow-pro-token.md +++ b/src/guides/v2.3/graphql/mutations/create-payflow-pro-token.md @@ -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 diff --git a/src/guides/v2.3/graphql/mutations/create-paypal-express-token.md b/src/guides/v2.3/graphql/mutations/create-paypal-express-token.md index f07e0487363..19df72287b4 100644 --- a/src/guides/v2.3/graphql/mutations/create-paypal-express-token.md +++ b/src/guides/v2.3/graphql/mutations/create-paypal-express-token.md @@ -13,7 +13,15 @@ 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 @@ -21,24 +29,23 @@ The input includes the cart ID, the payment method code, and a set of URLs that ```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 + } + } } ``` @@ -48,9 +55,9 @@ mutation { { "data": { "createPaypalExpressToken": { - "token": "" + "token": "", "paypal_urls": { - "start": "https://www.sandbox.paypal.com/checkoutnow?token=" + "start": "https://www.sandbox.paypal.com/checkoutnow?token=", "edit": "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&useraction=continue&token=" } } diff --git a/src/guides/v2.3/graphql/mutations/delete-customer-address.md b/src/guides/v2.3/graphql/mutations/delete-customer-address.md index f982b70515c..15dc4c569ee 100644 --- a/src/guides/v2.3/graphql/mutations/delete-customer-address.md +++ b/src/guides/v2.3/graphql/mutations/delete-customer-address.md @@ -9,7 +9,15 @@ To return or modify information about a customer, Magento recommends you use cus ## Syntax -`mutation: {deleteCustomerAddress(id: Int!) {Boolean}}` +```graphql +mutation { + deleteCustomerAddress( + id: Int! + ) { + Boolean + } +} +``` ## Example usage diff --git a/src/guides/v2.3/graphql/mutations/delete-payment-token.md b/src/guides/v2.3/graphql/mutations/delete-payment-token.md index dd62c70a93c..912c46a2dba 100644 --- a/src/guides/v2.3/graphql/mutations/delete-payment-token.md +++ b/src/guides/v2.3/graphql/mutations/delete-payment-token.md @@ -10,7 +10,15 @@ You must specify the customer's authorization token in the header of the call. ## Syntax -`mutation: {deletePaymentToken(public_hash) {DeletePaymentTokenOutput}}` +```graphql +mutation { + deletePaymentToken( + public_hash: String! + ) { + DeletePaymentTokenOutput + } +} +``` ## Example usage @@ -34,7 +42,6 @@ mutation { } } } - ``` **Response:** diff --git a/src/guides/v2.3/graphql/mutations/generate-customer-token.md b/src/guides/v2.3/graphql/mutations/generate-customer-token.md index ca05f83f319..fe634a936b1 100644 --- a/src/guides/v2.3/graphql/mutations/generate-customer-token.md +++ b/src/guides/v2.3/graphql/mutations/generate-customer-token.md @@ -9,7 +9,16 @@ To return or modify information about a customer, Magento recommends you use cus ## Syntax -`mutation: {generateCustomerToken(email: String!password: String!) {CustomerToken}}` +```graphql +mutation { + generateCustomerToken( + email: String! + password: String! + ) { + CustomerToken + } +} +``` ## Example usage diff --git a/src/guides/v2.3/graphql/mutations/handle-payflow-pro-response.md b/src/guides/v2.3/graphql/mutations/handle-payflow-pro-response.md index 25bd4bf87cd..ca3540b8159 100644 --- a/src/guides/v2.3/graphql/mutations/handle-payflow-pro-response.md +++ b/src/guides/v2.3/graphql/mutations/handle-payflow-pro-response.md @@ -22,7 +22,15 @@ See [Paypal Payflow Pro payment method]({{page.baseurl}}/graphql/payment-methods ## Syntax -`handlePayflowProResponse(input: PayflowProResponseInput!): PayflowProResponseOutput` +```graphql +mutation { + handlePayflowProResponse( + input: PayflowProResponseInput! + ) { + PayflowProResponseOutput + } +} +``` ## Example usage @@ -37,7 +45,7 @@ mutation { cart_id: "Po1WkfK7d3vZE0qga610NwJIbxgqllpt" paypal_payload: "$payload" } - ){ + ) { cart { selected_payment_method { code diff --git a/src/guides/v2.3/graphql/mutations/index.md b/src/guides/v2.3/graphql/mutations/index.md index 89284b173c6..33c99e47ef7 100644 --- a/src/guides/v2.3/graphql/mutations/index.md +++ b/src/guides/v2.3/graphql/mutations/index.md @@ -19,11 +19,13 @@ A mutation contains the following elements: The following example shows the structure of the `createCustomer` mutation: -```text -mutation myCreateCustomer{ - createCustomer( - input: CustomerInput!): CustomerOutput - } +```graphql +mutation myCreateCustomer { + createCustomer( + input: CustomerInput! + ) { + CustomerOutput + } } ``` @@ -31,21 +33,20 @@ In this example, `myCreateCustomer` identifies your implementation. `CustomerIn Now let's take a look at a fully-defined mutation. This time, we'll specify the minimum fields needed as input to create a customer (`firstname`, `lastname`, `email`, and `password`). We could include the same fields in the output, but GraphQL allows you to return only the data you need, which is the customer `email`. -```text -mutation myCreateCustomerNoVariables{ - createCustomer( - input: { - firstname: "Melanie" - lastname: "Shaw" - email: "mshaw@example.com" - password: "Password1" - } - ) - { - customer { - email - } +```graphql +mutation myCreateCustomerNoVariables { + createCustomer( + input: { + firstname: "Melanie" + lastname: "Shaw" + email: "mshaw@example.com" + password: "Password1" + } + ) { + customer { + email } + } } ``` @@ -54,12 +55,12 @@ The mutation returns the customer email: ```json { "data": { - "createCustomer": { - "customer": { - "email" : "mshaw@example.com" - } - } + "createCustomer": { + "customer": { + "email" : "mshaw@example.com" + } } + } } ``` @@ -67,15 +68,14 @@ The mutation returns the customer email: A mutation can require either an object as input (as shown above) or one or more scalar values. When specifying an object, you must include the `input: {}` keyword. When the mutation requires scalar values, specify the field name and value, as shown below: -```text -mutation myGenerateCustomerToken{ - generateCustomerToken( - email: "mshaw@example.com" - password: "Password1" - ) - { - token - } +```graphql +mutation myGenerateCustomerToken { + generateCustomerToken( + email: "mshaw@example.com" + password: "Password1" + ) { + token + } } ``` @@ -89,16 +89,15 @@ Specifying variables in a mutation can help increase code re-use. Consider the f The following example declares the `$CustomerInput` variable. It is referenced in the `input` statement. -```text -mutation myCreateCustomerWithVariables($CustomerInput: CustomerInput!){ - createCustomer( - input: $CustomerInput - ) - { - customer { - email - } +```graphql +mutation myCreateCustomerWithVariables($CustomerInput: CustomerInput!) { + createCustomer( + input: $CustomerInput + ) { + customer { + email } + } } ``` @@ -106,30 +105,29 @@ The `$CustomerInput` variable is defined as a JSON object: ```json { -"CustomerInput": { + "CustomerInput": { "firstname": "Melanie", "lastname": "Shaw", "email": "mshaw@example.com", "password": "Password1" - } + } } ``` This example updates the customer's email using two scalar variables (`$email`, `$password`). -```text -mutation myUpdateCustomer($email: String!, $password: String!){ - updateCustomer( - input: { - email: $email - password: $password - } - ) - { - customer { - email - } +```graphql +mutation myUpdateCustomer($email: String!, $password: String!) { + updateCustomer( + input: { + email: $email + password: $password } + ) { + customer { + email + } + } } ``` @@ -137,7 +135,7 @@ The variables are defined separately. ```json { - "email": "melanie.shaw@example.com", - "password": "Password1" + "email": "melanie.shaw@example.com", + "password": "Password1" } ``` diff --git a/src/guides/v2.3/graphql/mutations/merge-carts.md b/src/guides/v2.3/graphql/mutations/merge-carts.md index 44f45647849..99a4c9b9ce6 100644 --- a/src/guides/v2.3/graphql/mutations/merge-carts.md +++ b/src/guides/v2.3/graphql/mutations/merge-carts.md @@ -11,7 +11,16 @@ Use the [`customerCart` query]({{page.baseurl}}/graphql/queries/customer-cart.ht ## Syntax -`mergeCarts(source_cart_id: String!, destination_cart_id: String!): Cart!` +```graphql +mutation { + mergeCarts( + source_cart_id: String! + destination_cart_id: String! + ) { + Cart! + } +} +``` ## Example usage diff --git a/src/guides/v2.3/graphql/mutations/place-order.md b/src/guides/v2.3/graphql/mutations/place-order.md index bdef96b4d96..391f33fff60 100644 --- a/src/guides/v2.3/graphql/mutations/place-order.md +++ b/src/guides/v2.3/graphql/mutations/place-order.md @@ -19,13 +19,21 @@ Perform the following actions before using the `placeOrder` mutation: ## Syntax -`mutation: {placeOrder(input: PlaceOrderInput): {PlaceOrderOutput}}` +```graphql +mutation { + placeOrder( + input: PlaceOrderInput + ) { + PlaceOrderOutput + } +} +``` ## Example usage **Request:** -``` text +```graphql mutation { placeOrder( input: { diff --git a/src/guides/v2.3/graphql/mutations/redeem-giftcard-balance.md b/src/guides/v2.3/graphql/mutations/redeem-giftcard-balance.md index a34e2b23999..6f1edb5d568 100644 --- a/src/guides/v2.3/graphql/mutations/redeem-giftcard-balance.md +++ b/src/guides/v2.3/graphql/mutations/redeem-giftcard-balance.md @@ -11,7 +11,15 @@ Run this mutation on behalf of logged-in customers only. [Authorization tokens]( ## Syntax - `mutation: redeemGiftCardBalanceAsStoreCredit(input: GiftCardAccountInput): GiftCardAccount` +```graphql +mutation { + redeemGiftCardBalanceAsStoreCredit( + input: GiftCardAccountInput + ) { + GiftCardAccount + } +} +``` ## Example usage @@ -22,7 +30,9 @@ The following example redeems the gift card with code `ā€œ056MHP57TJ5Cā€`. ```graphql mutation { redeemGiftCardBalanceAsStoreCredit( - input : { gift_card_code: ā€œ056MHP57TJ5Cā€} + input: { + gift_card_code: "056MHP57TJ5C" + } ) { balance { currency diff --git a/src/guides/v2.3/graphql/mutations/remove-coupon.md b/src/guides/v2.3/graphql/mutations/remove-coupon.md index 1bd814b258d..1ac36411dfa 100644 --- a/src/guides/v2.3/graphql/mutations/remove-coupon.md +++ b/src/guides/v2.3/graphql/mutations/remove-coupon.md @@ -9,7 +9,15 @@ The `removeCouponFromCart` mutation removes a previously-applied coupon from the ## Syntax -`mutation: {removeCouponFromCart(input: RemoveCouponFromCartInput) {RemoveCouponFromCartOutput}}` +```graphql +mutation { + removeCouponFromCart( + input: RemoveCouponFromCartInput + ) { + RemoveCouponFromCartOutput + } +} +``` ## Example usage @@ -17,12 +25,13 @@ The following example removes a coupon from the cart. **Request:** -``` text +```graphql mutation { removeCouponFromCart( - input: - { cart_id: "IeTUiU0oCXjm0uRqGCOuhQ2AuQatogjG" } - ) { + input: { + cart_id: "IeTUiU0oCXjm0uRqGCOuhQ2AuQatogjG" + } + ) { cart { items { product { @@ -34,7 +43,7 @@ mutation { code } prices { - grand_total{ + grand_total { value currency } diff --git a/src/guides/v2.3/graphql/mutations/remove-giftcard.md b/src/guides/v2.3/graphql/mutations/remove-giftcard.md index e7063fb6301..7de37e952bf 100644 --- a/src/guides/v2.3/graphql/mutations/remove-giftcard.md +++ b/src/guides/v2.3/graphql/mutations/remove-giftcard.md @@ -8,7 +8,15 @@ The `removeGiftCardFromCart` mutation removes a previously-applied gift card fro ## Syntax - `mutation: removeGiftCardFromCart(input: RemoveGiftCardFromCartInput): RemoveGiftCardFromCartOutput` +```graphql +mutation { + removeGiftCardFromCart( + input: RemoveGiftCardFromCartInput + ) { + RemoveGiftCardFromCartOutput + } +} +``` ## Example usage @@ -16,7 +24,7 @@ The `removeGiftCardFromCart` mutation removes a previously-applied gift card fro **Request:** - ``` text +```graphql mutation { removeGiftCardFromCart( input: { @@ -35,7 +43,7 @@ mutation { **Response:** - ```json +```json { "data": { "removeGiftCardFromCart": { diff --git a/src/guides/v2.3/graphql/mutations/remove-item.md b/src/guides/v2.3/graphql/mutations/remove-item.md index 19e7d06c37e..fa93ec6bb2d 100644 --- a/src/guides/v2.3/graphql/mutations/remove-item.md +++ b/src/guides/v2.3/graphql/mutations/remove-item.md @@ -9,7 +9,15 @@ The `removeItemFromCart` mutation deletes the entire quantity of a specified ite ## Syntax -`mutation: {removeItemFromCart(input: RemoveItemFromCartInput): {RemoveItemFromCartOutput}}` +```graphql +mutation { + removeItemFromCart( + input: RemoveItemFromCartInput + ) { + RemoveItemFromCartOutput + } +} +``` ## Example usage @@ -24,24 +32,23 @@ mutation { cart_id: "IeTUiU0oCXjm0uRqGCOuhQ2AuQatogjG", cart_item_id: 14 } - ) - { - cart { - items { - id - product { - name + ) { + cart { + items { + id + product { + name + } + quantity } - quantity - } - prices { - grand_total{ - value - currency + prices { + grand_total { + value + currency + } } } } - } } ``` diff --git a/src/guides/v2.3/graphql/mutations/remove-store-credit.md b/src/guides/v2.3/graphql/mutations/remove-store-credit.md index 3358dcf752b..6f59bfa570d 100644 --- a/src/guides/v2.3/graphql/mutations/remove-store-credit.md +++ b/src/guides/v2.3/graphql/mutations/remove-store-credit.md @@ -10,7 +10,15 @@ Store credit must be enabled on the store to run this mutation. ## Syntax -`mutation: {RemoveStoreCreditFromCart(input: RemoveStoreCreditFromCartInput): {RemoveStoreCreditFromCartOutput}}` +```graphql +mutation { + removeStoreCreditFromCart( + input: RemoveStoreCreditFromCartInput + ) { + RemoveStoreCreditFromCartOutput + } +} +``` ## Example usage diff --git a/src/guides/v2.3/graphql/mutations/revoke-customer-token.md b/src/guides/v2.3/graphql/mutations/revoke-customer-token.md index 98a74de561c..764d7cc873f 100644 --- a/src/guides/v2.3/graphql/mutations/revoke-customer-token.md +++ b/src/guides/v2.3/graphql/mutations/revoke-customer-token.md @@ -9,7 +9,13 @@ To return or modify information about a customer, Magento recommends you use cus ## Syntax -`mutation: {revokeCustomerToken: RevokeCustomerTokenOutput}` +```graphql +mutation { + revokeCustomerToken { + RevokeCustomerTokenOutput + } +} +``` ## Example usage diff --git a/src/guides/v2.3/graphql/mutations/send-email-to-friend.md b/src/guides/v2.3/graphql/mutations/send-email-to-friend.md index 6d45c412ef0..665775fe67f 100644 --- a/src/guides/v2.3/graphql/mutations/send-email-to-friend.md +++ b/src/guides/v2.3/graphql/mutations/send-email-to-friend.md @@ -10,7 +10,15 @@ The **Stores** > **Configuration** > **Catalog** > **Email to a friend** > **Ena ## Syntax -`mutation: {sendEmailToFriend(input: SendEmailToFriendInput): {SendEmailToFriendOutput}}` +```graphql +mutation { + sendEmailToFriend( + input: SendEmailToFriendInput + ) { + SendEmailToFriendOutput + } +} +``` ## Example usage diff --git a/src/guides/v2.3/graphql/mutations/set-billing-address.md b/src/guides/v2.3/graphql/mutations/set-billing-address.md index f39e5b2273e..e2d49d8e9d0 100644 --- a/src/guides/v2.3/graphql/mutations/set-billing-address.md +++ b/src/guides/v2.3/graphql/mutations/set-billing-address.md @@ -9,7 +9,15 @@ The `setBillingAddressOnCart` mutation sets the billing address for a specific c ## Syntax -`mutation: {setBillingAddressOnCart(input: SetBillingAddressOnCartInput) {SetBillingAddressOnCartOutput}}` +```graphql +mutation { + setBillingAddressOnCart( + input: SetBillingAddressOnCartInput + ) { + SetBillingAddressOnCartOutput + } +} +``` ## Example usage diff --git a/src/guides/v2.3/graphql/mutations/set-guest-email.md b/src/guides/v2.3/graphql/mutations/set-guest-email.md index ce1ec4d252c..5408d9ba3bd 100644 --- a/src/guides/v2.3/graphql/mutations/set-guest-email.md +++ b/src/guides/v2.3/graphql/mutations/set-guest-email.md @@ -11,7 +11,15 @@ A logged-in customer specifies an email address when they create an account. The ## Syntax -`mutation: {setGuestEmailOnCart(input: SetGuestEmailOnCartInput): {SetGuestEmailOnCartOutput}}` +```graphql +mutation { + setGuestEmailOnCart( + input: SetGuestEmailOnCartInput + ) { + SetGuestEmailOnCartOutput + } +} +``` ## Example usage diff --git a/src/guides/v2.3/graphql/mutations/set-payment-method.md b/src/guides/v2.3/graphql/mutations/set-payment-method.md index a787be206b7..48bd835da8b 100644 --- a/src/guides/v2.3/graphql/mutations/set-payment-method.md +++ b/src/guides/v2.3/graphql/mutations/set-payment-method.md @@ -30,7 +30,15 @@ Supported online payment methods include: ## Syntax -`mutation: {setPaymentMethodOnCart(input: SetPaymentMethodOnCartInput): SetPaymentMethodOnCartOutput}}` +```graphql +mutation { + setPaymentMethodOnCart( + input: SetPaymentMethodOnCartInput + ) { + SetPaymentMethodOnCartOutput + } +} +``` ## Example usage @@ -40,14 +48,16 @@ The following example assigns the `banktransfer` payment method to the specified **Request:** -```text +```graphql mutation { - setPaymentMethodOnCart(input: { + setPaymentMethodOnCart( + input: { cart_id: "rMQdWEecBZr4SVWZwj2AF6y0dNCKQ8uH" payment_method: { code: "banktransfer" } - }) { + } + ) { cart { selected_payment_method { code diff --git a/src/guides/v2.3/graphql/mutations/set-payment-place-order.md b/src/guides/v2.3/graphql/mutations/set-payment-place-order.md index 5f693d10633..be25f4c3cab 100644 --- a/src/guides/v2.3/graphql/mutations/set-payment-place-order.md +++ b/src/guides/v2.3/graphql/mutations/set-payment-place-order.md @@ -25,7 +25,15 @@ Perform the following actions before using the `setPaymentMethodAndPlaceOrder` m ## Syntax -`mutation: {setPaymentMethodAndPlaceOrder(input: SetPaymentMethodAndPlaceOrderInput): PlaceOrderOutput}` +```graphql +mutation { + setPaymentMethodAndPlaceOrder( + input: SetPaymentMethodAndPlaceOrderInput + ) { + PlaceOrderOutput + } +} +``` ## Example usage diff --git a/src/guides/v2.3/graphql/mutations/set-shipping-address.md b/src/guides/v2.3/graphql/mutations/set-shipping-address.md index 62e2759ea1b..e26c829b76f 100644 --- a/src/guides/v2.3/graphql/mutations/set-shipping-address.md +++ b/src/guides/v2.3/graphql/mutations/set-shipping-address.md @@ -12,7 +12,15 @@ The `setShippingAddressesOnCart` mutation sets one or more shipping addresses on ## Syntax -`mutation: {setShippingAddressesOnCart(input: SetShippingAddressesOnCartInput) {SetShippingAddressesOnCartOutput}}` +```graphql +mutation { + setShippingAddressesOnCart( + input: SetShippingAddressesOnCartInput + ) { + SetShippingAddressesOnCartOutput + } +} +``` ## Example usage diff --git a/src/guides/v2.3/graphql/mutations/set-shipping-method.md b/src/guides/v2.3/graphql/mutations/set-shipping-method.md index 9ca66b37470..03192bdc038 100644 --- a/src/guides/v2.3/graphql/mutations/set-shipping-method.md +++ b/src/guides/v2.3/graphql/mutations/set-shipping-method.md @@ -19,7 +19,15 @@ United States Postal Service | usps | Varies ## Syntax -`mutation: {setShippingMethodsOnCart(input: setShippingMethodsOnCartInput) {setShippingMethodsOnCartOutput}}` +```graphql +mutation { + setShippingMethodsOnCart( + input: setShippingMethodsOnCartInput + ) { + setShippingMethodsOnCartOutput + } +} +``` ## Example usage diff --git a/src/guides/v2.3/graphql/mutations/update-cart-items.md b/src/guides/v2.3/graphql/mutations/update-cart-items.md index b67133283cb..9c24356477a 100644 --- a/src/guides/v2.3/graphql/mutations/update-cart-items.md +++ b/src/guides/v2.3/graphql/mutations/update-cart-items.md @@ -12,7 +12,15 @@ Setting the quantity to `0` removes an item from the cart. ## Syntax -`mutation: {updateCartItems(input: UpdateCartItemsInput): {UpdateCartItemsOutput}}` +```graphql +mutation { + updateCartItems( + input: UpdateCartItemsInput + ) { + UpdateCartItemsOutput + } +} +``` ## Example usage @@ -32,7 +40,7 @@ mutation { } ] } - ){ + ) { cart { items { id diff --git a/src/guides/v2.3/graphql/mutations/update-customer-address.md b/src/guides/v2.3/graphql/mutations/update-customer-address.md index 072f92e3391..f759a2c9035 100644 --- a/src/guides/v2.3/graphql/mutations/update-customer-address.md +++ b/src/guides/v2.3/graphql/mutations/update-customer-address.md @@ -9,7 +9,16 @@ To return or modify information about a customer, Magento recommends you use cus ## Syntax -`mutation: {updateCustomerAddress(id: Int!, input: CustomerAddressInput) {CustomerAddress}}` +```graphql +mutation { + updateCustomerAddress( + id: Int! + input: CustomerAddressInput + ) { + CustomerAddress + } +} +``` ## Example usage @@ -19,10 +28,13 @@ The following call updates the customer's city and postcode. ```graphql mutation { - updateCustomerAddress(id:3, input: { - city: "New City" - postcode: "55555" - }) { + updateCustomerAddress( + id:3 + input: { + city: "New City" + postcode: "55555" + } + ) { id city postcode diff --git a/src/guides/v2.3/graphql/mutations/update-customer.md b/src/guides/v2.3/graphql/mutations/update-customer.md index 814da10f0c5..f7ec56839ad 100644 --- a/src/guides/v2.3/graphql/mutations/update-customer.md +++ b/src/guides/v2.3/graphql/mutations/update-customer.md @@ -9,7 +9,15 @@ To return or modify information about a customer, Magento recommends you use cus ## Syntax -`mutation: {updateCustomer(input: CustomerInput!) {CustomerOutput}}` +```graphql +mutation { + updateCustomer( + input: CustomerInput! + ) { + CustomerOutput + } +} +``` ## Example usage