addWishlistItemsToCart
addWishlistItemsToCart is a Magento 2 GraphQL mutation in the Wishlist module. Add items in the specified wishlist to the customer's cart. It returns AddWishlistItemsToCartOutput and requires an Authorization header (Bearer customer token).
Last verified: against Magento 2.4.9.
Returns
Resolver class
Magento\WishlistGraphQl\Model\Resolver\Wishlist\AddToCart
Arguments
The unique ID of the wish list
An array of IDs representing products to be added to the cart. If no IDs are specified, all items in the wishlist will be added to the cart
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
Query
mutation ($wishlistId: ID!) {
addWishlistItemsToCart(wishlistId: $wishlistId) {
wishlist {
id
items {
id
qty
description
added_at
product { ... }
}
items_v2 {
items { ... }
page_info { ... }
}
items_count
sharing_code
updated_at
}
status
add_wishlist_items_to_cart_user_errors {
message
code
wishlistId
wishlistItemId
}
}
}Variables
{
"wishlistId": ""
}Related in WishlistGraphQl
Other fields shipped by the same module.
addProductsToWishlist
Add one or more products to the specified wish list. This mutation supports all product types.
Wishlist · returns AddProductsToWishlistOutput
clearWishlist
Remove all the products from the specified wish list.
Wishlist · returns RemoveProductsFromWishlistOutput
removeProductsFromWishlist
Remove one or more products from the specified wish list.
Wishlist · returns RemoveProductsFromWishlistOutput
updateProductsInWishlist
Update one or more products in the specified wish list.
Wishlist · returns UpdateProductsInWishlistOutput
wishlist
DeprecatedReturn the contents of a customer's wish list.
Wishlist · returns WishlistOutput
Every Magento dev tool, in one hosted workspace.
Free to sign up. Nothing to install. Drafts, audits, and projects saved across every tool.