Adobe Commerce only. Learn more
clearCart mutation
The clearCart
mutation removes all items from the specified cart.
Syntax
Copied to your clipboardmutation {clearCart(input: ClearCartInput) {ClearCartOutput}}
Reference
The clearCart
reference provides detailed information about the types and fields defined in this mutation.
Example usage
Request:
Copied to your clipboardmutation {clearCart(input: {uid: "B79Qefk7pUaxahYtO8WjOtr5UyEyjaYV"}) {cart {iditemsV2 {items {uid}}}errors {message}}}
Response:
The response is the cart with no items.
Copied to your clipboard{"data": {"clearCart": {"cart": {"id": "B79Qefk7pUaxahYtO8WjOtr5UyEyjaYV","itemsV2": {"items": []}},"errors": null}}}