clearWishlist mutation
The clearWishlist
mutation removes all items from a wishlist for the logged in customer.
This mutation requires a valid customer authentication token.
This mutation is part of the Storefront Compatibility Package. It will be added to Adobe Commerce 2.4.9.
Syntax
Copied to your clipboardmutation {clearWishlist(wishlistId: int) {user_errors {codemessage}wishlist {iditems_countnamesharing_codeupdated_atvisibility}}}
Example usage
The following example clears the wishlist with ID 15
for the customer.
Request:
Copied to your clipboardmutation {clearWishlist(wishlistId: 15) {user_errors {codemessage}wishlist {iditems_countnamesharing_codeupdated_atvisibility}}
Response:
Copied to your clipboard{"data": {"clearWishlist": {"user_errors": [],"wishlist": {"id": "15","items_count": 0,"name": "Wish List","sharing_code": "l6jgZ3VJxNeJguCJpbFTMMagkr5TKaep","updated_at": "2025-05-27 07:26:09","visibility": "PRIVATE"}}}}