Delete Cart
Use the deleteCart mutation to delete a cart, and all items associated to it.
Mutation
deleteCart(input: DeleteCartInput!): DeletePayload!
| Arguments | Type |
|---|---|
input | DeleteCartInput! |
The deleteCart mutation will always return the DeletePayload object.
DeleteCartInput!
| Argument | Type | Description |
|---|---|---|
id | ID! | The id of the Cart you wish to delete. |
If no cart exists with the id provided, the DeletePayload response will tell you.
DeletePayload
| Field | Type | Description |
|---|---|---|
success | Boolean! | Either true or false. If an error occurs, it will be false with a message. |
message | String | A 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"
}
}
}