Skip to content

Create Wishlist Item

About

The createWishlist mutation adds a product to the authenticated customer's wishlist. Use this mutation to:

  • Add products to the wishlist from product pages
  • Implement "Add to Wishlist" buttons and heart icons
  • Save products for later purchase
  • Build wishlist flows programmatically

The customer is automatically detected from the Bearer token — no customer ID is needed in the input.

Authentication

This mutation requires customer authentication:

  • Authenticated customers: Provide a valid customer authentication token in the Authorization header. Obtain this token via the Customer Login API.
Authorization: Bearer <accessToken>

Arguments

ArgumentTypeDescription
productIdIntThe ID of the product to add to the wishlist.
clientMutationIdStringOptional client-side mutation identifier for tracking.

Possible Returns

FieldTypeDescription
wishlistWishlist!The newly created wishlist item.
wishlist.idID!IRI identifier (e.g. /api/shop/wishlists/70).
wishlist._idInt!Numeric identifier.
wishlist.productProduct!The associated product with id, name, price.
wishlist.createdAtStringTimestamp when the item was added.

Released under the MIT License.