deleteWishlist mutation
Magento Commerce only
The content on this page is for Magento Commerce only.
Learn more
The deleteWishlist
mutation deletes the specified wish list. In Magento Commerce, you cannot delete the customer’s default (first) wish list. This mutation is not available in Magento Open Source.
This mutation requires a valid customer authentication token.
Syntax
1
2
3
mutation {
deleteWishlist(wishlistId: ID!): DeleteWishlistOutput
}
Example usage
The following example deletes a wish list.
Request:
1
2
3
4
5
6
7
8
9
10
mutation{
deleteWishlist(wishlistId: 3){
status
wishlists {
id
name
items_count
}
}
}
Response:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
"data": {
"deleteWishlist": {
"status": true,
"wishlists": [
{
"id": "1",
"name": "Vacation Wants",
"items_count": 7
},
{
"id": "2",
"name": "Lose the Muffintop",
"items_count": 6
}
]
}
}
}
Input attributes
The deleteWishlist
mutation requires the following input.
Attribute | Data Type | Description |
---|---|---|
wishlistId |
ID! | The ID of the wish list to delete |
Output attributes
The DeleteWishlistOutput object can contain the following attributes:
Attribute | Data Type | Description |
---|---|---|
status |
Boolean! | Indicates whether the wish list was deleted |
wishlists |
[Wishlist]! | An array of wish lists that have not been deleted |
Wishlist attributes
The Wishlist
object contains all the items in the customer’s wish list.
Attribute | Data type | Description |
---|---|---|
id |
ID | The unique ID of a Wishlist object |
items |
[WishlistItem] | Deprecated. Use items_v2 instead |
items_v2 |
[WishlistItemInterface] | An array of items in the customer’s wish list |
items_count |
Int | The number of items in the wish list |
name |
String | The wish list name. Applicable to Magento Commerce only |
sharing_code |
String | An encrypted code that Magento uses to link to the wish list |
updated_at |
String | The time of the last modification to the wish list |
visibility |
WishlistVisibilityEnum! | An enum indicating whether the wish list is PUBLIC or PRIVATE. Applicable to Magento Commerce only |
WishlistItem attributes
The WishlistItem
object can contain the following attributes.
Attribute | Data type | Description |
---|---|---|
added_at |
String | The time when the customer added the item to the wish list |
description |
String | The customer’s comment about this item |
id |
Int | The wish list item ID |
product |
ProductInterface | The ProductInterface contains attributes that are common to all types of products. Note that descriptions may not be available for custom and EAV attributes |
qty |
Float | The quantity of this wish list item |