Skip to content

Delete All Wishlist Items

About

The createDeleteAllWishlists mutation removes all items from the authenticated customer's wishlist at once. Use this mutation to:

  • Clear the entire wishlist
  • Implement a "Clear All" button on the wishlist page
  • Reset the customer's wishlist state

The wishlist is resolved from the Bearer token, so there is nothing to identify in the input — the mutation always clears the calling customer's own wishlist.

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.

Pass an empty input object; clientMutationId is the only field the mutation accepts.

Possible Returns

FieldTypeDescription
deleteAllWishlists.idID!Identifier of the operation result.
deleteAllWishlists.messageStringMessage confirming the wishlist was cleared.
deleteAllWishlists.deletedCountIntNumber of items removed. 0 when the wishlist was already empty.

Clearing an already-empty wishlist is not an error — the mutation succeeds and returns deletedCount: 0 with the same message, so a "Clear All" button needs no guard against an empty list.

Released under the MIT License.