Delete Cart

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

Mutation

deleteCart(input: DeleteCartInput!): DeletePayload!

ArgumentsType
inputDeleteCartInput!

The deleteCart mutation will always return the DeletePayload object.

DeleteCartInput!

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

If no cart exists with the id provided, the DeletePayload response will tell you.

DeletePayload

FieldTypeDescription
successBoolean!Either true or false. If an error occurs, it will be false with a message.
messageStringA success or failure message will be returned.

Example

mutation {
  deleteCart(input: { id: "ck5r8d5b500003f5o2aif0v2b" }) {
    success
    message
  }
}
{
  "data": {
    "deleteCart": {
      "success": true,
      "message": "Cart successfully deleted"
    }
  }
}
{
  "data": {
    "deleteCart": {
      "success": false,
      "message": "Cart does not exist"
    }
  }
}