MageSmith
MutationWishlist · Magento 2.4.9

removeProductsFromWishlist

removeProductsFromWishlist is a Magento 2 GraphQL mutation in the Wishlist module. Remove one or more products from the specified wish list. It returns RemoveProductsFromWishlistOutput and requires an Authorization header (Bearer customer token).

Last verified: against Magento 2.4.9.

Returns

RemoveProductsFromWishlistOutput

Resolver class

\Magento\WishlistGraphQl\Model\Resolver\RemoveProductsFromWishlist

Arguments

wishlistId ID! Required

The ID of a wish list.

wishlistItemsIds [ID!]! Required

An array of item IDs representing products to be removed.

Example request

Auto-generated from the SDL — paste-ready against your store's /graphql endpoint. Replace the host, store code, and any required values before running.

Headers

Content-Type
application/json
Store
default store view code; use 'default' for the single-store baseline
Authorization
Bearer <CUSTOMER_TOKEN> obtain from generateCustomerToken mutation

Query

mutation ($wishlistId: ID!, $wishlistItemsIds: [ID!]!) {
  removeProductsFromWishlist(wishlistId: $wishlistId, wishlistItemsIds: $wishlistItemsIds) {
    wishlist {
      id
      items {
        id
        qty
        description
        added_at
        product { ... }
      }
      items_v2 {
        items { ... }
        page_info { ... }
      }
      items_count
      sharing_code
      updated_at
    }
    user_errors {
      message
      code
    }
  }
}

Variables

{
  "wishlistId": "",
  "wishlistItemsIds": [
    ""
  ]
}

Every Magento dev tool, in one hosted workspace.

Free to sign up. Nothing to install. Drafts, audits, and projects saved across every tool.