Delete All Compare Items
About
The createDeleteAllCompareItems mutation removes all products from the authenticated customer's comparison list at once. Use this mutation to:
- Clear the entire comparison list
- Implement a "Clear All" button for the compare feature
- Reset the customer's comparison state
Note: This is an authenticated-only operation. The customer is auto-detected from the Bearer token.
Authentication
This mutation requires customer authentication:
- Authenticated customers: Provide a valid customer authentication token in the
Authorizationheader. Obtain this token via the Customer Login API.
Authorization: Bearer <accessToken>Arguments
| Argument | Type | Description |
|---|---|---|
clientMutationId | String | Optional client-side mutation identifier for tracking. |
Note: No additional input is required. Pass an empty input
{}.
Possible Returns
| Field | Type | Description |
|---|---|---|
deleteAllCompareItems.message | String! | Success message confirming deletion. |
deleteAllCompareItems.deletedCount | Int! | Number of compare items that were removed. |

