Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

[Cart Operations] Remove item mutation #373

Merged
merged 5 commits into from
Mar 1, 2019

Conversation

pmclain
Copy link
Contributor

@pmclain pmclain commented Feb 14, 2019

Description (*)

Mutation for deleting cart items.

#37

Manual testing scenarios (*)

  1. Create empty cart
mutation {
  createEmptyCart
}
  1. Add product to cart
mutation AddToCart($cartId: String!) {
  addSimpleProductsToCart(input: {
    cart_id:$cartId
    cartItems:[
      {
        data: {
          sku:"product_dynamic_1",
          qty:2
        }
      }
      {
        data: {
          sku:"product_dynamic_2",
          qty:2
        }
      }
    ]
  }) {
    cart {
      cart_id
      items {
        id
        qty
        product {
          sku
        }
      }
    }
  }
}
  1. Delete item from cart
mutation RemoveFromCart($cartId: String!, $itemId: String!) {
  removeItemFromCart(input: {
    cart_id:$cartId
    cart_item_id:$itemId
  }) {
    cart {
      cart_id
      items {
        id
        qty
        product {
          sku
        }
      }
    }
  }
}
  1. Validate deleted item is no longer present in response

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

# Conflicts:
#	app/code/Magento/QuoteGraphQl/etc/schema.graphqls
@magento-engcom-team magento-engcom-team merged commit 445c02d into magento:2.3-develop Mar 1, 2019
@ghost
Copy link

ghost commented Mar 1, 2019

Hi @pmclain, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@keharper
Copy link
Contributor

Documented as part of magento/devdocs#4502

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants