Skip to content

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 Authorization header. Obtain this token via the Customer Login API.
Authorization: Bearer <accessToken>

Arguments

ArgumentTypeDescription
clientMutationIdStringOptional client-side mutation identifier for tracking.

Note: No additional input is required. Pass an empty input {}.

Possible Returns

FieldTypeDescription
deleteAllCompareItems.messageString!Success message confirming deletion.
deleteAllCompareItems.deletedCountInt!Number of compare items that were removed.

Released under the MIT License.