Empty Cart

Use the emptyCart mutation to delete a cart, and all items associated to it.

Mutation

emptyCart(input: EmptyCartInput!): Cart!

ArgumentsType
inputEmptyCartInput!

The emptyCart mutation will always return the emptied Cart.

EmptyCartInput!

ArgumentTypeDescription
idID!The id of the Cart you wish to empty.

If no cart item exists with the id provided, an error will be returned.

Example

mutation {
  emptyCart(input: { id: "ck5r8d5b500003f5o2aif0v2b" }) {
    id
    totalItems
    totalUniqueItems
  }
}
{
  "data": {
    "emptyCart": {
      "id": "ck5r8d5b500003f5o2aif0v2b",
      "totalItems": 0,
      "totalUniqueItems": 0
    }
  }
}