Skip to main content

wishlistRemoveItem

Overview

Use this mutation to delete a product from a session/account wishlist. Pass the necessary identifiers via RemoveFromWishlistInput (account/session identifiers plus product info). The API responds with the refreshed wishlist data.

  • Type: GraphQL Mutation
  • Endpoint: https://subdomain.com
  • Authentication: Authorization: Bearer <TOKEN> (required for account wishlists)

Mutation

mutation RemoveFromWishlist($input: RemoveFromWishlistInput!) {
removeFromWishlist(input: $input) {
success
message
data {
_id
accountId
sessionId
app
products {
_id
title
slug
description
app
tags
status
publishedAt
images { _id fileUrl }
collections {
_id
app
title
slug
description
operation
image { _id fileUrl }
}
seo { title description keywords image canonicalUrl }
pricing { compareAtPrice originalPrice price }
variantsCount
dimensions { height width unit }
weight { weight unit }
variants {
_id
product
options {
_id
option { name }
label
type
sortOrder
createdAt
updatedAt
}
images { _id fileUrl }
pricing { originalPrice price compareAtPrice }
quantity
weight { unit weight }
}
options {
_id
product
valuesCount
values { _id label type sortOrder createdAt updatedAt }
name
createdAt
updatedAt
}
}
createdAt
updatedAt
}
}
}

Variables

{
"input": {
"accountId": "<ACCOUNT_ID>",
"sessionId": "<SESSION_ID>",
"productId": "<PRODUCT_ID>"
}
}

Examples

curl -X POST \
https://subdomain.com\
-H "Content-Type": "application/json" \
-H "Authorization: Bearer <TOKEN>" \
--data-binary @- << 'EOF'
{
"query": "mutation RemoveFromWishlist($input: RemoveFromWishlistInput!) { removeFromWishlist(input: $input) { success message data { _id products { _id title } } } }",
"variables": {
"input": {
"accountId": "<ACCOUNT_ID>",
"sessionId": "<SESSION_ID>",
"productId": "<PRODUCT_ID>"
}
}
}
EOF

Notes

  • Some implementations infer wishlist ownership; pass either accountId or sessionId (or both) as required.
  • After removal, sync UI with the returned data to show the updated product list.