removeProductsFromWishlist mutation
The removeProductsFromWishlist
mutation completely removes the specified items from the customer's wish list. Use the updateProductsInWishlist
mutation to change the quantity of specific items in the wish list.
This mutation requires a valid customer authentication token.
Syntax
Copied to your clipboardmutation {removeProductsFromWishlist(wishlistId: ID!wishlistItemsIds: [ID!]!) {RemoveProductsFromWishlistOutput}}
Reference
The removeProductsFromWishlist
reference provides detailed information about the types and fields defined in this mutation.
Example usage
The following example removes an item that was added in the addProductsToWishlist
mutation example.
Request:
Copied to your clipboardmutation {removeProductsFromWishlist(wishlistId: 4wishlistItemsIds: [26]){wishlist {iditems_countitems_v2 {items {idquantityproduct {uidnameskuprice_range {minimum_price {regular_price {currencyvalue}}maximum_price {regular_price {currencyvalue}}}}}}}user_errors {codemessage}}}
Response:
Copied to your clipboard{"data": {"removeProductsFromWishlist": {"wishlist": {"id": "4","items_count": 2,"items_v2": {"items": [{"id": "27","quantity": 1,"product": {"uid": "MTIyNg==","name": "Stellar Solar Jacket","sku": "WJ01","price_range": {"minimum_price": {"regular_price": {"currency": "USD","value": 75}},"maximum_price": {"regular_price": {"currency": "USD","value": 75}}}}},{"id": "28","quantity": 1,"product": {"uid": "NTI=","name": "Sprite Yoga Companion Kit","sku": "24-WG080","price_range": {"minimum_price": {"regular_price": {"currency": "USD","value": 61}},"maximum_price": {"regular_price": {"currency": "USD","value": 77}}}}}]}},"user_errors": []}}}
Errors
Error | Description |
---|---|
The current user cannot perform operations on wishlist | An unauthorized user (guest) tried to add an item to a wishlist, or an authorized user (customer) tried to add an item to a wishlist of another customer. |
The wishlist was not found. | The value provided in the wishlistId field is invalid or does not exist for the customer. |