From 7d12ae560df9fa4fb0337ffccc757e6a2bc0b7e4 Mon Sep 17 00:00:00 2001 From: Kevin Harper Date: Thu, 12 Nov 2020 15:30:05 -0600 Subject: [PATCH 01/10] GraphQL: Document WishlistItemInterface --- src/_data/toc/graphql.yml | 4 + .../graphql/wishlist-item-interface.md | 10 + src/_includes/graphql/wishlist.md | 5 +- .../interfaces/wishlist-item-interface.md | 174 ++++++++++++++++++ 4 files changed, 191 insertions(+), 2 deletions(-) create mode 100644 src/_includes/graphql/wishlist-item-interface.md create mode 100644 src/guides/v2.4/graphql/interfaces/wishlist-item-interface.md diff --git a/src/_data/toc/graphql.yml b/src/_data/toc/graphql.yml index 0f7ef894588..6c640f47b8b 100644 --- a/src/_data/toc/graphql.yml +++ b/src/_data/toc/graphql.yml @@ -501,6 +501,10 @@ pages: url: /graphql/interfaces/shipment-item-interface.html exclude_versions: ["2.3"] + - label: WishlistItemInterface attributes and implementations + url: /graphql/interfaces/wishlist-item-interface.html + exclude_versions: ["2.3"] + - label: Payment methods children: diff --git a/src/_includes/graphql/wishlist-item-interface.md b/src/_includes/graphql/wishlist-item-interface.md new file mode 100644 index 00000000000..e95b6bf3c41 --- /dev/null +++ b/src/_includes/graphql/wishlist-item-interface.md @@ -0,0 +1,10 @@ +The `WishlistItemInterface` contains the following attributes. + +Attribute | Data type | Description +--- | --- | --- +`added_at` | String! | The date and time the item was added to the wish list +`customizable_options`| [SelectedCustomizableOption] | Custom options selected for the wish list item +`description`| String | The description of the item +`id`| ID! | The ID of the wish list item +`product` | [ProductInterface]({{page.baseurl}}/graphql/interfaces/product-interface.html) | Product details of the wish list item +`quantity`| Float! | The quantity of this wish list item diff --git a/src/_includes/graphql/wishlist.md b/src/_includes/graphql/wishlist.md index 5bc13a10beb..3dfc0555094 100644 --- a/src/_includes/graphql/wishlist.md +++ b/src/_includes/graphql/wishlist.md @@ -3,7 +3,8 @@ The `Wishlist` object contains all the items in the customer's wish list. Attribute | Data type | Description --- | --- | --- `id` | ID | The unique identifier of the wish list -`items` | [[WishlistItem](#WishlistItem)] | An array of items in the customer's wish list +`items` | [[WishlistItem](#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 `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 @@ -18,4 +19,4 @@ Attribute | Data type | Description `description` | String | The customer's comment about this item `id` | Int | The wish list item ID `product` | [ProductInterface]({{ page.baseurl }}/graphql/interfaces/product-interface.html) | 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 \ No newline at end of file +`qty` | Float | The quantity of this wish list item diff --git a/src/guides/v2.4/graphql/interfaces/wishlist-item-interface.md b/src/guides/v2.4/graphql/interfaces/wishlist-item-interface.md new file mode 100644 index 00000000000..905da29ba95 --- /dev/null +++ b/src/guides/v2.4/graphql/interfaces/wishlist-item-interface.md @@ -0,0 +1,174 @@ +--- +group: graphql +title: WishlistItemInterface attributes and implementations +--- + +`WishlistItemInterface` provides details about items in a wish list. It has the following implementations: + +* [`BundleWishlistItem`](#BundleWishlistItem) +* [`ConfigurableWishlistItem`](#ConfigurableWishlistItem) +* [`DownloadableWishlistItem`](#DownloadableWishlistItem) +* [`GiftCardWishlistItem`](#GiftCardWishlistItem) +* [`GroupedProductWishlistItem`](#GroupedProductWishlistItem) +* [`SimpleWishlistItem`](#SimpleWishlistItem) +* [`VirtualWishlistItem`](#VirtualWishlistItem) + +## Attributes + +{% include graphql/wishlist-item-interface.md %} + +## Implementations + +### BundleWishlistItem attributes {#BundleWishlistItem} + +The `BundleWishlistItem` object defines the following bundle-product specific attribute: + +Attribute | Data type | Description +--- | --- | --- +`bundle_options` | [SelectedBundleOption!]| An array containing information about the selected bundle items + +### ConfigurableWishlistItem attributes {#ConfigurableWishlistItem} + +The `ConfigurableWishlistItem` object defines the following attributes that are specific to configurable products: + +Attribute | Data type | Description +--- | --- | --- +`child_sku` | String! | The SKU of the simple product corresponding to a set of selected configurable options +`configurable_options` | [SelectedConfigurableOption!] An array of selected configurable options + +### DownloadableWishlistItem attributes {#DownloadableWishlistItem} + +The `DownloadableWishlistItem` object defines the following attributes that are specific to downloadable products: + +Attribute | Data type | Description +--- | --- | --- +`links_v2` | [DownloadableProductLinks] | An array containing information about the selected links +`samples` | [DownloadableProductSamples] | An array containing information about the selected samples + +### GiftCardWishlistItem attributes {#GiftCardWishlistItem} + +The `GiftCardWishlistItem` object defines the following gift card-specific attribute: + +Attribute | Data type | Description +--- | --- | --- +`gift_card_options` | GiftCardOptions! | Contains details about a gift card product + +#### GiftCardOptions attributes {#GiftCardOptions} + +The GiftCardOptions object provides details about a gift card. All attributes are optional for a wish list. + +Attribute | Data type | Description +--- | --- | --- +`amount` | Money | The amount and currency of the gift card +`custom_giftcard_amount` | Money | The custom amount and currency of the gift card +`message` | String | A message to the recipient +`recipient_email` | String | The email of the person receiving the gift card +`recipient_name` | String | The name of the person receiving the gift card +`sender_email` | String | The email of the sender +`sender_name` | String | The name of the sender + +### GroupedProductWishlistItem attributes {#GroupedProductWishlistItem} + +The GroupedProductWishlistItem data type does not extend the `WishlistItemInterface`. + +### SimpleWishlistItem attributes (#SimpleWishlistItem) + +The SimpleWishlistItem data type does not extend the `WishlistItemInterface`. + +### VirtualWishlistItem attributes {#VirtualWishlistItem} + +The VirtualWishlistItem data type does not extend the `WishlistItemInterface`. + +## Example usage + +The following mutation adds a downloadable product to the cart and returns detailed information about the product. + +**Request:** + +```graphql +mutation { + addProductsToWishlist( + wishlistId: 0, + wishlistItems: [ + { + sku: "240-LV06" + quantity: 1 + } + ] +) { + user_errors { + code + message + } + wishlist { + id + sharing_code + items_count + updated_at + items_v2 { + id + description + quantity + added_at + ... on DownloadableWishlistItem { + links_v2 { + uid + title + sample_url + } + samples { + title + sample_url + } + } + } + } + } +} +``` +**Response:** + +```json +{ + "data": { + "addProductsToWishlist": { + "user_errors": [], + "wishlist": { + "id": "3", + "sharing_code": "cVeOljNmNKm0e1jRFj7PRMyBXrpu88Sf", + "items_count": 1, + "updated_at": "2020-11-12 03:01:46", + "items_v2": [ + { + "id": "14", + "description": null, + "quantity": 1, + "added_at": "2020-11-12 03:01:46", + "links_v2": [ + { + "uid": "ZG93bmxvYWRhYmxlLzM=", + "title": "Yoga Adventure", + "sample_url": "http://hbb2b.test/downloadable/download/linkSample/link_id/3/" + } + ], + "samples": [ + { + "title": "Trailer #1", + "sample_url": "http://hbb2b.test/downloadable/download/sample/sample_id/7/" + }, + { + "title": "Trailer #2", + "sample_url": "http://hbb2b.test/downloadable/download/sample/sample_id/8/" + }, + { + "title": "Trailer #3", + "sample_url": "http://hbb2b.test/downloadable/download/sample/sample_id/9/" + } + ] + } + ] + } + } + } +} +``` From 90d7c5cf2e75f3149cae8c5af1af8c91440b5c99 Mon Sep 17 00:00:00 2001 From: Kevin Harper Date: Wed, 18 Nov 2020 13:26:03 -0600 Subject: [PATCH 02/10] checkpoint --- src/_data/toc/graphql.yml | 4 ++ .../mutations/add-wishlist-items-to-cart.md | 60 +++++++++++++++++++ .../v2.4/graphql/mutations/create-wishlist.md | 7 +-- .../v2.4/graphql/mutations/update-wishlist.md | 6 +- 4 files changed, 69 insertions(+), 8 deletions(-) create mode 100644 src/guides/v2.4/graphql/mutations/add-wishlist-items-to-cart.md diff --git a/src/_data/toc/graphql.yml b/src/_data/toc/graphql.yml index 6c640f47b8b..1422ad21411 100644 --- a/src/_data/toc/graphql.yml +++ b/src/_data/toc/graphql.yml @@ -191,6 +191,10 @@ pages: - label: addVirtualProductsToCart mutation url: /graphql/mutations/add-virtual-products.html + - label: addWishlistItemsToCart mutation + url: /graphql/mutations/add-wishlist-to-cart.html + exclude_versions: ["2.3"] + - label: applyCouponToCart mutation url: /graphql/mutations/apply-coupon.html diff --git a/src/guides/v2.4/graphql/mutations/add-wishlist-items-to-cart.md b/src/guides/v2.4/graphql/mutations/add-wishlist-items-to-cart.md new file mode 100644 index 00000000000..25c0aba862f --- /dev/null +++ b/src/guides/v2.4/graphql/mutations/add-wishlist-items-to-cart.md @@ -0,0 +1,60 @@ +--- +group: graphql +title: addWishlistItemsToCart mutation +--- + +The `addWishlistItemsToCart` mutation adds items. + +## Syntax + +```graphql +addWishlistItemsToCart( + wishlistUid: ID!, + wishlistItemUids: [ID!] + ): AddWishlistItemsToCartOutput +``` + +## Example usage + +**Request:** + +``` graphql + +``` + +**Response:** + +```json + +``` + +## Input attributes + +The `addWishlistItemsToCart` mutation requires the following input. + +Attribute | Data Type | Description +--- | --- | --- + + +### WishlistItemInput attributes {#WishlistItemInput} + +The `WishlistItemInput` object defines each item to add to the wish list. + +Attribute | Data Type | Description +--- | --- | --- + +## Output attributes + +The + +Attribute | Data Type | Description +--- | --- | --- + + +### Wishlist attributes {#Wishlist} + +{% include graphql/wishlist.md %} + +### WishListUserInputError attributes {#WishListUserInputError} + +{% include graphql/wishlist-user-input-errors.md %} diff --git a/src/guides/v2.4/graphql/mutations/create-wishlist.md b/src/guides/v2.4/graphql/mutations/create-wishlist.md index dc30548f985..a62f15656eb 100644 --- a/src/guides/v2.4/graphql/mutations/create-wishlist.md +++ b/src/guides/v2.4/graphql/mutations/create-wishlist.md @@ -19,10 +19,7 @@ Use the [`storeConfig` query]({{page.baseurl}}/graphql/queries/store-config.html ```graphql mutation { - createWishlist( - name: String! - visibility: WishlistVisibilityEnum! - ) { + createWishlist(input: CreateWishlistInput!) { CreateWishlistOutput } } @@ -61,7 +58,7 @@ mutation { ## Input attributes -The `createWishlist` mutation requires the following input. +The `CreateWishlistInput` object requires the following input. Attribute | Data Type | Description --- | --- | --- diff --git a/src/guides/v2.4/graphql/mutations/update-wishlist.md b/src/guides/v2.4/graphql/mutations/update-wishlist.md index 5c4677aa8fd..a8b8a586d67 100644 --- a/src/guides/v2.4/graphql/mutations/update-wishlist.md +++ b/src/guides/v2.4/graphql/mutations/update-wishlist.md @@ -16,7 +16,7 @@ This mutation requires a valid [customer authentication token]({{page.baseurl}}/ ```graphql mutation { updateWishlist( - wishlistId: ID! + wishlistUid: ID! name: String visibility: WishlistVisibilityEnum ) { @@ -34,7 +34,7 @@ The following example changes the name of an existing wish list. ``` graphql mutation { updateWishlist( - wishlistId: 4 + wishlistUid: 4 name: "My favorite things" visibility: PUBLIC ) { @@ -67,7 +67,7 @@ Attribute | Data Type | Description --- | --- | --- `name` | String! | The ID of the customer's wish list `visibility`| WishlistVisibilityEnum! | Describes the visibility of the wish list. Possible values are `PRIVATE` and `PUBLIC` -`wishlistId` | ID! | The ID of the wish list to update +`wishlistUid` | ID! | The ID of the wish list to update ## Output attributes From f8dd0d9f80a2cf8b0d7162d6ff186073dd631bda Mon Sep 17 00:00:00 2001 From: Kevin Harper Date: Mon, 30 Nov 2020 18:28:32 -0600 Subject: [PATCH 03/10] Rename/update mutations --- src/_data/toc/graphql.yml | 12 +- .../interfaces/wishlist-item-interface.md | 2 +- .../mutations/add-wishlist-items-to-cart.md | 60 ---- .../copy-products-between-wishlists.md | 184 +++++++++++++ .../mutations/copy-products-to-wishlist.md | 143 ---------- .../v2.4/graphql/mutations/create-wishlist.md | 25 +- .../v2.4/graphql/mutations/delete-wishlist.md | 15 +- .../move-products-between-wishlists.md | 258 ++++++++++++++++++ .../mutations/move-products-to-wishlist.md | 117 -------- 9 files changed, 473 insertions(+), 343 deletions(-) delete mode 100644 src/guides/v2.4/graphql/mutations/add-wishlist-items-to-cart.md create mode 100644 src/guides/v2.4/graphql/mutations/copy-products-between-wishlists.md delete mode 100644 src/guides/v2.4/graphql/mutations/copy-products-to-wishlist.md create mode 100644 src/guides/v2.4/graphql/mutations/move-products-between-wishlists.md delete mode 100644 src/guides/v2.4/graphql/mutations/move-products-to-wishlist.md diff --git a/src/_data/toc/graphql.yml b/src/_data/toc/graphql.yml index 1422ad21411..45c3d50c99f 100644 --- a/src/_data/toc/graphql.yml +++ b/src/_data/toc/graphql.yml @@ -191,10 +191,6 @@ pages: - label: addVirtualProductsToCart mutation url: /graphql/mutations/add-virtual-products.html - - label: addWishlistItemsToCart mutation - url: /graphql/mutations/add-wishlist-to-cart.html - exclude_versions: ["2.3"] - - label: applyCouponToCart mutation url: /graphql/mutations/apply-coupon.html @@ -214,8 +210,8 @@ pages: - label: changeCustomerPassword mutation url: /graphql/mutations/change-customer-password.html - - label: copyProductsToWishlist mutation - url: /graphql/mutations/copy-products-to-wishlist.html + - label: copyProductsBetweenWishlists mutation + url: /graphql/mutations/copy-products-between-wishlists.html edition: ee-only exclude_versions: ["2.3"] @@ -319,8 +315,8 @@ pages: - label: mergeCarts mutation url: /graphql/mutations/merge-carts.html - - label: moveProductsToWishlist mutation - url: /graphql/mutations/move-products-to-wishlist.html + - label: moveProductsBetweenWishlists mutation + url: /graphql/mutations/move-products-between-wishlists.html edition: ee-only exclude_versions: ["2.3"] diff --git a/src/guides/v2.4/graphql/interfaces/wishlist-item-interface.md b/src/guides/v2.4/graphql/interfaces/wishlist-item-interface.md index 905da29ba95..bffd66e2320 100644 --- a/src/guides/v2.4/graphql/interfaces/wishlist-item-interface.md +++ b/src/guides/v2.4/graphql/interfaces/wishlist-item-interface.md @@ -71,7 +71,7 @@ Attribute | Data type | Description The GroupedProductWishlistItem data type does not extend the `WishlistItemInterface`. -### SimpleWishlistItem attributes (#SimpleWishlistItem) +### SimpleWishlistItem attributes {#SimpleWishlistItem} The SimpleWishlistItem data type does not extend the `WishlistItemInterface`. diff --git a/src/guides/v2.4/graphql/mutations/add-wishlist-items-to-cart.md b/src/guides/v2.4/graphql/mutations/add-wishlist-items-to-cart.md deleted file mode 100644 index 25c0aba862f..00000000000 --- a/src/guides/v2.4/graphql/mutations/add-wishlist-items-to-cart.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -group: graphql -title: addWishlistItemsToCart mutation ---- - -The `addWishlistItemsToCart` mutation adds items. - -## Syntax - -```graphql -addWishlistItemsToCart( - wishlistUid: ID!, - wishlistItemUids: [ID!] - ): AddWishlistItemsToCartOutput -``` - -## Example usage - -**Request:** - -``` graphql - -``` - -**Response:** - -```json - -``` - -## Input attributes - -The `addWishlistItemsToCart` mutation requires the following input. - -Attribute | Data Type | Description ---- | --- | --- - - -### WishlistItemInput attributes {#WishlistItemInput} - -The `WishlistItemInput` object defines each item to add to the wish list. - -Attribute | Data Type | Description ---- | --- | --- - -## Output attributes - -The - -Attribute | Data Type | Description ---- | --- | --- - - -### Wishlist attributes {#Wishlist} - -{% include graphql/wishlist.md %} - -### WishListUserInputError attributes {#WishListUserInputError} - -{% include graphql/wishlist-user-input-errors.md %} diff --git a/src/guides/v2.4/graphql/mutations/copy-products-between-wishlists.md b/src/guides/v2.4/graphql/mutations/copy-products-between-wishlists.md new file mode 100644 index 00000000000..0b7dce5aae6 --- /dev/null +++ b/src/guides/v2.4/graphql/mutations/copy-products-between-wishlists.md @@ -0,0 +1,184 @@ +--- +group: graphql +title: copyProductsBetweenWishlists mutation +ee_only: true +--- + +The `copyProductsBetweenWishlists` mutation copies the specified quantities of one or more products to a different wish list. The original wish list is unchanged. + +Use the [`customer` query]({{page.baseurl}}/graphql/queries/customer.html) to return a list of wish list IDs and item IDs. + +This mutation requires a valid [customer authentication token]({{page.baseurl}}/graphql/mutations/generate-customer-token.html). + +## Syntax + +```graphql +mutation { + copyProductsBetweenWishlists( + sourceWishlistUid: ID!, + destinationWishlistUid: ID!, + wishlistItems: [WishlistItemCopyInput!]! + ){ + CopyProductsBetweenWishlistsOutput + } +} +``` + +## Example usage + +The following example copies two items to another wish list. + +**Request:** + +``` graphql +mutation{ + copyProductsBetweenWishlists(sourceWishlistUid: 1, destinationWishlistUid: 2, wishlistItems: [ + { + wishlist_item_id: 6 + quantity: 1 + } + { + wishlist_item_id: 7 + quantity: 1 + } + ]){ + destination_wishlist { + id + items_v2 { + items { + id + product { + id + sku + name + } + } + } + } + user_errors { + code + message + } + } +} +``` + +**Response:** + +```json +{ + "data": { + "copyProductsBetweenWishlists": { + "destination_wishlist": { + "id": "2", + "items_v2": { + "items": [ + { + "id": "8", + "product": { + "id": 51, + "sku": "240-LV08", + "name": "Advanced Pilates & Yoga (Strength)" + } + }, + { + "id": "9", + "product": { + "id": 18, + "sku": "24-UG02", + "name": "Pursuit Lumaflex™ Tone Band" + } + }, + { + "id": "10", + "product": { + "id": 1452, + "sku": "WS04", + "name": "Layla Tee" + } + }, + { + "id": "11", + "product": { + "id": 1564, + "sku": "WS12", + "name": "Radiant Tee" + } + }, + { + "id": "12", + "product": { + "id": 1612, + "sku": "WB01", + "name": "Electra Bra Top" + } + }, + { + "id": "13", + "product": { + "id": 1644, + "sku": "WB03", + "name": "Celeste Sports Bra" + } + }, + { + "id": "14", + "product": { + "id": 1724, + "sku": "WT03", + "name": "Nora Practice Tank" + } + }, + { + "id": "15", + "product": { + "id": 1692, + "sku": "WT01", + "name": "Bella Tank" + } + } + ] + } + }, + "user_errors": [] + } + } +} +``` + +## Input attributes + +The `copyProductsToWishlist` mutation requires the following input. + +Attribute | Data Type | Description +--- | --- | --- +`destinationWishlistUid` | ID! | The ID of the wishlist to copy products to +`sourceWishlistUid` | ID! | The ID of the origin wishlist +`wishlistItems` | [WishlistItemCopyInput!]! | A list of items to be copied + +### WishlistItemCopyInput attributes {#WishlistItemCopyInput} + +The WishlistItemCopyInput object contains the following attributes. + +Attribute | Data Type | Description +--- | --- | --- +`quantity` | Float | The quantity of this item to move to the destination wish list. This value cannot be greater than the quantity in the source wish list +`wishlist_item_id` | ID! | The ID of the item to be copied + +## Output attributes + +The `CopyProductsBetweenWishlistsOutput` object can contain the following attributes. + +Attribute | Data Type | Description +--- | --- | --- +`destination_wishlist` | [Wishlist!](#Wishlist) | The destination wish list containing the copied products +`source_wishlist` | [Wishlist!](#Wishlist) | The wish list that the products were copied from +`user_errors` | [[WishListUserInputError!](#WishListUserInputError)] | An array of errors encountered while copying products in a wish list + +### Wishlist attributes {#Wishlist} + +{% include graphql/wishlist.md %} + +### WishListUserInputError attributes {#WishListUserInputError} + +{% include graphql/wishlist-user-input-errors.md %} diff --git a/src/guides/v2.4/graphql/mutations/copy-products-to-wishlist.md b/src/guides/v2.4/graphql/mutations/copy-products-to-wishlist.md deleted file mode 100644 index e52046d04bf..00000000000 --- a/src/guides/v2.4/graphql/mutations/copy-products-to-wishlist.md +++ /dev/null @@ -1,143 +0,0 @@ ---- -group: graphql -title: copyProductsToWishlist mutation -ee_only: true ---- - -The `copyProductsToWishlist` mutation copies the specified quantities of one or more products to a different wish list. The original wish list is unchanged. - -Use the [`customer` query]({{page.baseurl}}/graphql/queries/customer.html) to return a list of wish list IDs and item IDs. - -This mutation requires a valid [customer authentication token]({{page.baseurl}}/graphql/mutations/generate-customer-token.html). - -## Syntax - -```graphql -mutation { - copyProductsToWishlist( - wishlistId: ID! - wishlistItems: [WishlistItemMoveInput!]! - ) { - UpdateProductsInWishlistOutput - } -} -``` - -## Example usage - -The following example copies two items to another wish list. - -**Request:** - -``` graphql -mutation { - copyProductsToWishlist( - wishlistId: 4 - wishlistItems: [{ - wishlist_item_id: 28 - quantity: 1 - } - { - wishlist_item_id:29 - quantity: 1 - }] - ) { - wishlist { - id - name - items_v2 { - id - quantity - product { - sku - name - } - } - } - } -} -``` - -**Response:** - -```json -{ - "data": { - "copyProductsToWishlist": { - "wishlist": { - "id": "4", - "name": "My favorite things", - "items_v2": [ - { - "id": "26", - "quantity": 1, - "product": { - "sku": "24-WG080", - "name": "Sprite Yoga Companion Kit" - } - }, - { - "id": "27", - "quantity": 1, - "product": { - "sku": "WSH12", - "name": "Erika Running Short" - } - }, - { - "id": "30", - "quantity": 1, - "product": { - "sku": "24-WB02", - "name": "Compete Track Tote" - } - }, - { - "id": "31", - "quantity": 1, - "product": { - "sku": "24-UG07", - "name": "Dual Handle Cardio Ball" - } - } - ] - } - } - } -} -``` - -## Input attributes - -The `copyProductsToWishlist` mutation requires the following input. - -Attribute | Data Type | Description ---- | --- | --- -`wishlistId` | ID! | The ID of the target wish list -`wishlistItems` | [WishlistItemCopyInput!]! | An array containing a set of wish list IDs that are to be copied - -### WishlistItemCopyInput attributes {#WishlistItemCopyInput} - -The WishlistItemCopyInput object contains the following attributes. - -Attribute | Data Type | Description ---- | --- | --- -`quantity` | Float | The quantity of this item to move to the destination wish list. This value cannot be greater than the quantity in the source wish list -`wishlist_item_id` | ID! | The ID of the item to be copied - -## Output attributes - -The `UpdateProductsInWishlistOutput` object can contain the following attributes. - -Attribute | Data Type | Description ---- | --- | --- -`user_errors` | [[WishListUserInputError!](#WishListUserInputError)]! | An array of errors encountered while adding products to a wish list -`wishlist` | [Wishlist!](#Wishlist) | Contains the wish list with all items that were successfully added - -### Wishlist attributes {#Wishlist} - -{% include graphql/wishlist.md %} - -### WishListUserInputError attributes {#WishListUserInputError} - -{% include graphql/wishlist-user-input-errors.md %} diff --git a/src/guides/v2.4/graphql/mutations/create-wishlist.md b/src/guides/v2.4/graphql/mutations/create-wishlist.md index a62f15656eb..35e389b2db7 100644 --- a/src/guides/v2.4/graphql/mutations/create-wishlist.md +++ b/src/guides/v2.4/graphql/mutations/create-wishlist.md @@ -33,12 +33,16 @@ The following example creates the `My favorites` public wish list. ``` graphql mutation { - createWishlist( + createWishlist(input: { name: "My favorites" visibility: PUBLIC + } ) { - uid - visibility + wishlist { + id + name + visibility + } } } ``` @@ -49,8 +53,11 @@ mutation { { "data": { "createWishlist": { - "uid": "4", - "visibility": "PUBLIC" + "wishlist": { + "id": "3", + "name": "My favorites", + "visibility": "PUBLIC" + } } } } @@ -67,10 +74,6 @@ Attribute | Data Type | Description ## Output attributes -The `CreateWishlistOutput` object returns the `uid` of the new wish list as well as the input attributes. +The `createWishlist` mutation returns the Wishlist object. -Attribute | Data Type | Description ---- | --- | --- -`name` | String! | The wish list name -`uid` | ID! | The ID of the new wish list -`visibility` | WishlistVisibilityEnum! | The wish list visibility. Possible values are `PRIVATE` and `PUBLIC` +{% include graphql/wishlist.md %} diff --git a/src/guides/v2.4/graphql/mutations/delete-wishlist.md b/src/guides/v2.4/graphql/mutations/delete-wishlist.md index 6ad3b0f8924..80723eafc6f 100644 --- a/src/guides/v2.4/graphql/mutations/delete-wishlist.md +++ b/src/guides/v2.4/graphql/mutations/delete-wishlist.md @@ -12,7 +12,7 @@ This mutation requires a valid [customer authentication token]({{page.baseurl}}/ ```graphql mutation { - deleteWishlist(wishlistId: ID!) + deleteWishlist(wishlistId: ID!): DeleteWishlistOutput } ``` @@ -44,8 +44,17 @@ The `deleteWishlist` mutation requires the following input. Attribute | Data Type | Description --- | --- | --- -`wishlistId` | ID! | The ID of the wish list to update +`wishlistId` | ID! | The ID of the wish list to delete ## Output attributes -The `deleteWishlist` object returns a Boolean value, indicating whether the request was successful. +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 {#Wishlist} + +{% include graphql/wishlist.md %} diff --git a/src/guides/v2.4/graphql/mutations/move-products-between-wishlists.md b/src/guides/v2.4/graphql/mutations/move-products-between-wishlists.md new file mode 100644 index 00000000000..2e7b1175e14 --- /dev/null +++ b/src/guides/v2.4/graphql/mutations/move-products-between-wishlists.md @@ -0,0 +1,258 @@ +--- +group: graphql +title: moveProductsBetweenWishlists mutation +ee_only: true +--- + +The `moveProductsBetweenWishlists` mutation moves the specified quantities of one or more products to a different wish list. + +If you do not specify a quantity for a product, the mutation moves the entire quantity of that product to the target wish list. + +Use the [`customer` query]({{page.baseurl}}/graphql/queries/customer.html) to return a list of wish list IDs and item IDs. + +This mutation requires a valid [customer authentication token]({{page.baseurl}}/graphql/mutations/generate-customer-token.html). + +## Syntax + +```graphql +mutation { + moveProductsBetweenWishlists( + sourceWishlistUid: ID!, + destinationWishlistUid: ID!, + wishlistItems: [WishlistItemMoveInput!]! + ) { + MoveProductsBetweenWishlistsOutput + } +} +``` + +## Example usage + +The following example moves an item to another wish list. The ID of the moved product changes. + +**Request:** + +``` graphql +mutation{ + moveProductsBetweenWishlists(sourceWishlistUid: 2, destinationWishlistUid: 1, wishlistItems: [ + { + wishlist_item_id: 9 + quantity: 1 + } + ]){ + source_wishlist { + id + items_v2 { + items { + id + product { + id + sku + name + } + } + } + } + destination_wishlist { + id + items_v2 { + items { + id + product { + id + sku + name + } + } + } + } + user_errors { + code + message + } + } +} +``` + +**Response:** + +```json +{ + "data": { + "moveProductsBetweenWishlists": { + "source_wishlist": { + "id": "2", + "items_v2": { + "items": [ + { + "id": "8", + "product": { + "id": 51, + "sku": "240-LV08", + "name": "Advanced Pilates & Yoga (Strength)" + } + }, + { + "id": "10", + "product": { + "id": 1452, + "sku": "WS04", + "name": "Layla Tee" + } + }, + { + "id": "11", + "product": { + "id": 1564, + "sku": "WS12", + "name": "Radiant Tee" + } + }, + { + "id": "12", + "product": { + "id": 1612, + "sku": "WB01", + "name": "Electra Bra Top" + } + }, + { + "id": "13", + "product": { + "id": 1644, + "sku": "WB03", + "name": "Celeste Sports Bra" + } + }, + { + "id": "14", + "product": { + "id": 1724, + "sku": "WT03", + "name": "Nora Practice Tank" + } + }, + { + "id": "15", + "product": { + "id": 1692, + "sku": "WT01", + "name": "Bella Tank" + } + } + ] + } + }, + "destination_wishlist": { + "id": "1", + "items_v2": { + "items": [ + { + "id": "1", + "product": { + "id": 13, + "sku": "24-WB07", + "name": "Overnight Duffle" + } + }, + { + "id": "2", + "product": { + "id": 10, + "sku": "24-WB05", + "name": "Savvy Shoulder Tote" + } + }, + { + "id": "3", + "product": { + "id": 11, + "sku": "24-WB06", + "name": "Endeavor Daytrip Backpack" + } + }, + { + "id": "4", + "product": { + "id": 1100, + "sku": "WH04", + "name": "Miko Pullover Hoodie" + } + }, + { + "id": "5", + "product": { + "id": 1228, + "sku": "WJ01", + "name": "Stellar Solar Jacket" + } + }, + { + "id": "6", + "product": { + "id": 1724, + "sku": "WT03", + "name": "Nora Practice Tank" + } + }, + { + "id": "7", + "product": { + "id": 1692, + "sku": "WT01", + "name": "Bella Tank" + } + }, + { + "id": "16", + "product": { + "id": 18, + "sku": "24-UG02", + "name": "Pursuit Lumaflex™ Tone Band" + } + } + ] + } + }, + "user_errors": [] + } + } +} +``` + +## Input attributes + +The `moveProductsBetweenWishlists` mutation requires the following input. + +Attribute | Data Type | Description +--- | --- | --- +`destinationWishlistUid` | ID! | The ID of the wishlist to move products to +`sourceWishlistUid` | ID! | The ID of the origin wishlist +`wishlistItems` | [WishlistItemMoveInput!]! | A list of items to be moved + +### WishlistItemMoveInput attributes {#WishlistItemMoveInput} + +The WishlistItemMoveInput object contains the following attributes. + +Attribute | Data Type | Description +--- | --- | --- +`quantity` | Float | The quantity of this item to move to the destination wish list. This value cannot be greater than the quantity in the source wish list +`wishlist_item_id` | ID! | The ID of the item to be moved + +## Output attributes + +The `MoveProductsBetweenWishlistsOutput` object can contain the following attributes. + +Attribute | Data Type | Description +--- | --- | --- +`destination_wishlist` | [Wishlist!](#Wishlist) | The destination wish list containing the moved products +`source_wishlist` | [Wishlist!](#Wishlist) | The wish list that the products were moved from +`user_errors` | [[WishListUserInputError!](#WishListUserInputError)] | An array of errors encountered while copying products in a wish list + +### Wishlist attributes {#Wishlist} + +{% include graphql/wishlist.md %} + +### WishListUserInputError attributes {#WishListUserInputError} + +{% include graphql/wishlist-user-input-errors.md %} diff --git a/src/guides/v2.4/graphql/mutations/move-products-to-wishlist.md b/src/guides/v2.4/graphql/mutations/move-products-to-wishlist.md deleted file mode 100644 index 91436e38927..00000000000 --- a/src/guides/v2.4/graphql/mutations/move-products-to-wishlist.md +++ /dev/null @@ -1,117 +0,0 @@ ---- -group: graphql -title: moveProductsToWishlist mutation -ee_only: true ---- - -The `moveProductsToWishlist` mutation moves the specified quantities of one or more products to a different wish list. Because the `wishlist_item_id` for each item placed in a wish list is unique, there is no need to specify the original wish list. - -If you do not specify a quantity for a product, the mutation moves the entire quantity of that product to the target wish list. - -Use the [`customer` query]({{page.baseurl}}/graphql/queries/customer.html) to return a list of wish list IDs and item IDs. - -This mutation requires a valid [customer authentication token]({{page.baseurl}}/graphql/mutations/generate-customer-token.html). - -## Syntax - -```graphql -mutation { - moveProductsToWishlist( - wishlistId: ID! - wishlistItems: [WishlistItemMoveInput!]! - ) { - UpdateProductsInWishlistOutput - } -} -``` - -## Example usage - -The following example moves an item to another wish list. The ID of the moved product changes. - -**Request:** - -``` graphql -mutation { - moveProductsToWishlist( - wishlistId: 4 - wishlistItems: { - wishlist_item_id: 20 - quantity: 1 - } - ) { - wishlist { - id - name - items_v2 { - id - quantity - product { - sku - name - } - } - } - } -} -``` - -**Response:** - -```json -{ - "data": { - "moveProductsToWishlist": { - "wishlist": { - "id": "4", - "name": "My favorite things", - "items_v2": [ - { - "id": "26", - "quantity": 1, - "product": { - "sku": "24-WG080", - "name": "Sprite Yoga Companion Kit" - } - } - ] - } - } - } -} -``` - -## Input attributes - -The `moveProductsToWishlist` mutation requires the following input. - -Attribute | Data Type | Description ---- | --- | --- -`wishlistId` | ID! | The ID of the wish list to update -`wishlistItems` | [WishlistItemMoveInput!]! | An array containing a set of wish list IDs that are to be moved - -### WishlistItemMoveInput attributes {#WishlistItemMoveInput} - -The WishlistItemMoveInput object contains the following attributes. - -Attribute | Data Type | Description ---- | --- | --- -`quantity` | Float | The quantity of this item to move to the destination wish list. This value cannot be greater than the quantity in the source wish list -`wishlist_item_id` | ID! | The ID of the item to be moved - -## Output attributes - -The `UpdateProductsInWishlistOutput` object can contain the following attributes. - -Attribute | Data Type | Description ---- | --- | --- -`user_errors` | [[WishListUserInputError!](#WishListUserInputError)] | An array of errors encountered while adding products to a wish list -`wishlist` | [Wishlist!](#Wishlist) | Contains the wish list with all items that were successfully added - -### Wishlist attributes {#Wishlist} - -{% include graphql/wishlist.md %} - -### WishListUserInputError attributes {#WishListUserInputError} - -{% include graphql/wishlist-user-input-errors.md %} From 6290ccbcca7e1005b223ed45846ee03927170a55 Mon Sep 17 00:00:00 2001 From: Kevin Harper Date: Tue, 1 Dec 2020 11:38:15 -0600 Subject: [PATCH 04/10] checkpoint --- src/_includes/graphql/wishlist.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/_includes/graphql/wishlist.md b/src/_includes/graphql/wishlist.md index 3dfc0555094..d5173a02296 100644 --- a/src/_includes/graphql/wishlist.md +++ b/src/_includes/graphql/wishlist.md @@ -6,8 +6,10 @@ Attribute | Data type | Description `items` | [[WishlistItem](#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 {{site.data.var.ee}} 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 {{site.data.var.ee}} only #### WishlistItem attributes {#WishlistItem} From f6a03483fc5e804b68957d4c9fa0d5d3ef3f1b82 Mon Sep 17 00:00:00 2001 From: Kevin Harper Date: Sat, 5 Dec 2020 23:32:45 -0600 Subject: [PATCH 05/10] Update examples and descriptions --- src/_includes/graphql/wishlist.md | 6 +- .../interfaces/wishlist-item-interface.md | 16 +- .../mutations/add-products-to-wishlist.md | 178 ++++++----- .../copy-products-between-wishlists.md | 26 +- .../v2.4/graphql/mutations/delete-wishlist.md | 10 +- .../move-products-between-wishlists.md | 42 +-- .../remove-products-from-wishlist.md | 135 ++++---- .../mutations/update-products-in-wishlist.md | 297 ++++++++++++------ .../v2.4/graphql/mutations/update-wishlist.md | 2 +- src/guides/v2.4/graphql/queries/customer.md | 193 +++++++++--- 10 files changed, 576 insertions(+), 329 deletions(-) diff --git a/src/_includes/graphql/wishlist.md b/src/_includes/graphql/wishlist.md index d5173a02296..57ef3e5bed9 100644 --- a/src/_includes/graphql/wishlist.md +++ b/src/_includes/graphql/wishlist.md @@ -2,9 +2,9 @@ The `Wishlist` object contains all the items in the customer's wish list. Attribute | Data type | Description --- | --- | --- -`id` | ID | The unique identifier of the wish list +`id` | ID | The unique ID of a `Wishlist` object `items` | [[WishlistItem](#WishlistItem)] | Deprecated. Use `items_v2` instead -`items_v2` | [WishlistItemInterface] | An array of items in the customer's wish list +`items_v2` | [[WishlistItemInterface]]({{page.baseurl/graphql/interfaces/wishlist-item/interface.html}}) | 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 {{site.data.var.ee}} only `sharing_code` | String | An encrypted code that Magento uses to link to the wish list @@ -20,5 +20,5 @@ 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]({{ page.baseurl }}/graphql/interfaces/product-interface.html) | The ProductInterface contains attributes that are common to all types of products. Note that descriptions may not be available for custom and EAV attributes +`product` | [ProductInterface]({{page.baseurl}}/graphql/interfaces/product-interface.html) | 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 diff --git a/src/guides/v2.4/graphql/interfaces/wishlist-item-interface.md b/src/guides/v2.4/graphql/interfaces/wishlist-item-interface.md index bffd66e2320..eb69bfbd6f1 100644 --- a/src/guides/v2.4/graphql/interfaces/wishlist-item-interface.md +++ b/src/guides/v2.4/graphql/interfaces/wishlist-item-interface.md @@ -34,7 +34,7 @@ The `ConfigurableWishlistItem` object defines the following attributes that are Attribute | Data type | Description --- | --- | --- `child_sku` | String! | The SKU of the simple product corresponding to a set of selected configurable options -`configurable_options` | [SelectedConfigurableOption!] An array of selected configurable options +`configurable_options` | [SelectedConfigurableOption!] | An array of selected configurable options ### DownloadableWishlistItem attributes {#DownloadableWishlistItem} @@ -88,7 +88,7 @@ The following mutation adds a downloadable product to the cart and returns detai ```graphql mutation { addProductsToWishlist( - wishlistId: 0, + wishlistId: 3, wishlistItems: [ { sku: "240-LV06" @@ -106,7 +106,7 @@ mutation { items_count updated_at items_v2 { - id + uid description quantity added_at @@ -140,7 +140,7 @@ mutation { "updated_at": "2020-11-12 03:01:46", "items_v2": [ { - "id": "14", + "uid": "MTQ=", "description": null, "quantity": 1, "added_at": "2020-11-12 03:01:46", @@ -148,21 +148,21 @@ mutation { { "uid": "ZG93bmxvYWRhYmxlLzM=", "title": "Yoga Adventure", - "sample_url": "http://hbb2b.test/downloadable/download/linkSample/link_id/3/" + "sample_url": "http://example.com/downloadable/download/linkSample/link_id/3/" } ], "samples": [ { "title": "Trailer #1", - "sample_url": "http://hbb2b.test/downloadable/download/sample/sample_id/7/" + "sample_url": "http://example.com/downloadable/download/sample/sample_id/7/" }, { "title": "Trailer #2", - "sample_url": "http://hbb2b.test/downloadable/download/sample/sample_id/8/" + "sample_url": "http://example.com/downloadable/download/sample/sample_id/8/" }, { "title": "Trailer #3", - "sample_url": "http://hbb2b.test/downloadable/download/sample/sample_id/9/" + "sample_url": "http://example.com/downloadable/download/sample/sample_id/9/" } ] } diff --git a/src/guides/v2.4/graphql/mutations/add-products-to-wishlist.md b/src/guides/v2.4/graphql/mutations/add-products-to-wishlist.md index bc10a882c92..e72aac9ff63 100644 --- a/src/guides/v2.4/graphql/mutations/add-products-to-wishlist.md +++ b/src/guides/v2.4/graphql/mutations/add-products-to-wishlist.md @@ -14,15 +14,21 @@ To determine whether wish lists are enabled, specify the `magento_wishlist_gener ## Syntax -`mutation: addProductsToWishlist(wishlistId: ID!, wishlistItems: [WishlistItemInput!]!): AddProductsToWishlistOutput` +```graphql +`mutation { + addProductsToWishlist( + wishlistId: ID!, + wishlistItems: [WishlistItemInput!]! + ){ + AddProductsToWishlistOutput + } +} +``` ## Example usage The following example adds a simple product (`24-MB01`), a configurable product (`WJ01-M-Red`), and a bundle product (`24-WG080`) to the customer's wish list. The SKU `WG-09` is invalid, and error information is returned in the `user_errors` object. -{:.bs-callout-info} -In Magento 2.4.1, the `addProductsToWishlist` mutation does not return `selected_options` or `entered_options` objects. Support for these objects will be provided in a future release. - To determine the value of the `wishlistId` attribute, run the `customer` query and check the value of `wishlist.id` in the response. **Request:** @@ -30,7 +36,7 @@ To determine the value of the `wishlistId` attribute, run the `customer` query a ``` graphql mutation { addProductsToWishlist( - wishlistId: 1 + wishlistId: 4 wishlistItems: [ { sku: "24-MB01" @@ -59,29 +65,31 @@ mutation { wishlist { id items_count - items { - id - qty - product { - name - sku + items_v2 { + items { id - price_range { - minimum_price { - regular_price { - currency - value + quantity + product { + name + sku + uid + price_range { + minimum_price { + regular_price { + currency + value + } } - } - maximum_price { - regular_price { - currency - value + maximum_price { + regular_price { + currency + value + } } } - } } } + } } user_errors { code @@ -98,79 +106,81 @@ mutation { "data": { "addProductsToWishlist": { "wishlist": { - "id": "1", + "id": "4", "items_count": 3, - "items": [ - { - "id": 16, - "qty": 1, - "product": { - "name": "Joust Duffle Bag", - "sku": "24-MB01", - "id": 1, - "price_range": { - "minimum_price": { - "regular_price": { - "currency": "USD", - "value": 34 - } - }, - "maximum_price": { - "regular_price": { - "currency": "USD", - "value": 34 + "items_v2": { + "items": [ + { + "id": "26", + "quantity": 1, + "product": { + "name": "Joust Duffle Bag", + "sku": "24-MB01", + "uid": "MQ==", + "price_range": { + "minimum_price": { + "regular_price": { + "currency": "USD", + "value": 34 + } + }, + "maximum_price": { + "regular_price": { + "currency": "USD", + "value": 34 + } } } } - } - }, - { - "id": 17, - "qty": 1, - "product": { - "name": "Stellar Solar Jacket", - "sku": "WJ01", - "id": 1226, - "price_range": { - "minimum_price": { - "regular_price": { - "currency": "USD", - "value": 75 - } - }, - "maximum_price": { - "regular_price": { - "currency": "USD", - "value": 75 + }, + { + "id": "27", + "quantity": 1, + "product": { + "name": "Stellar Solar Jacket", + "sku": "WJ01", + "uid": "MTIyNg==", + "price_range": { + "minimum_price": { + "regular_price": { + "currency": "USD", + "value": 75 + } + }, + "maximum_price": { + "regular_price": { + "currency": "USD", + "value": 75 + } } } } - } - }, - { - "id": 18, - "qty": 1, - "product": { - "name": "Sprite Yoga Companion Kit", - "sku": "24-WG080", - "id": 46, - "price_range": { - "minimum_price": { - "regular_price": { - "currency": "USD", - "value": 61 - } - }, - "maximum_price": { - "regular_price": { - "currency": "USD", - "value": 77 + }, + { + "id": "28", + "quantity": 1, + "product": { + "name": "Sprite Yoga Companion Kit", + "sku": "24-WG080", + "uid": "NTI=", + "price_range": { + "minimum_price": { + "regular_price": { + "currency": "USD", + "value": 61 + } + }, + "maximum_price": { + "regular_price": { + "currency": "USD", + "value": 77 + } } } } } - } - ] + ] + } }, "user_errors": [ { diff --git a/src/guides/v2.4/graphql/mutations/copy-products-between-wishlists.md b/src/guides/v2.4/graphql/mutations/copy-products-between-wishlists.md index 0b7dce5aae6..9c9d2d167ac 100644 --- a/src/guides/v2.4/graphql/mutations/copy-products-between-wishlists.md +++ b/src/guides/v2.4/graphql/mutations/copy-products-between-wishlists.md @@ -48,7 +48,7 @@ mutation{ items { id product { - id + uid sku name } @@ -76,7 +76,7 @@ mutation{ { "id": "8", "product": { - "id": 51, + "uid": "NDk=", "sku": "240-LV08", "name": "Advanced Pilates & Yoga (Strength)" } @@ -84,7 +84,7 @@ mutation{ { "id": "9", "product": { - "id": 18, + "uid": "MTg=", "sku": "24-UG02", "name": "Pursuit Lumaflex™ Tone Band" } @@ -92,7 +92,7 @@ mutation{ { "id": "10", "product": { - "id": 1452, + "uid": "MTQ1MA==", "sku": "WS04", "name": "Layla Tee" } @@ -100,7 +100,7 @@ mutation{ { "id": "11", "product": { - "id": 1564, + "uid": "MTU2Mg==", "sku": "WS12", "name": "Radiant Tee" } @@ -108,7 +108,7 @@ mutation{ { "id": "12", "product": { - "id": 1612, + "uid": "MTYxMA==", "sku": "WB01", "name": "Electra Bra Top" } @@ -116,23 +116,23 @@ mutation{ { "id": "13", "product": { - "id": 1644, + "uid": "MTY0Mg==", "sku": "WB03", "name": "Celeste Sports Bra" } }, { - "id": "14", + "id": "15", "product": { - "id": 1724, + "uid": "MTcyMg==", "sku": "WT03", "name": "Nora Practice Tank" } }, { - "id": "15", + "id": "16", "product": { - "id": 1692, + "uid": "MTY5MA==", "sku": "WT01", "name": "Bella Tank" } @@ -163,7 +163,7 @@ The WishlistItemCopyInput object contains the following attributes. Attribute | Data Type | Description --- | --- | --- `quantity` | Float | The quantity of this item to move to the destination wish list. This value cannot be greater than the quantity in the source wish list -`wishlist_item_id` | ID! | The ID of the item to be copied +`wishlist_item_id` | ID! | The unique ID of the `WishlistItemInterface` object to be copied ## Output attributes @@ -173,7 +173,7 @@ Attribute | Data Type | Description --- | --- | --- `destination_wishlist` | [Wishlist!](#Wishlist) | The destination wish list containing the copied products `source_wishlist` | [Wishlist!](#Wishlist) | The wish list that the products were copied from -`user_errors` | [[WishListUserInputError!](#WishListUserInputError)] | An array of errors encountered while copying products in a wish list +`user_errors` | [[WishListUserInputError!](#WishListUserInputError)] | An array of errors encountered while copying products to a wish list ### Wishlist attributes {#Wishlist} diff --git a/src/guides/v2.4/graphql/mutations/delete-wishlist.md b/src/guides/v2.4/graphql/mutations/delete-wishlist.md index 80723eafc6f..3d18f2a2f15 100644 --- a/src/guides/v2.4/graphql/mutations/delete-wishlist.md +++ b/src/guides/v2.4/graphql/mutations/delete-wishlist.md @@ -23,8 +23,10 @@ The following example deletes a wish list. **Request:** ``` graphql -mutation { - deleteWishlist(wishlistId: 3) +mutation{ + deleteWishlist(wishlistId: 5){ + status + } } ``` @@ -33,7 +35,9 @@ mutation { ```json { "data": { - "deleteWishlist": true + "deleteWishlist": { + "status": true + } } } ``` diff --git a/src/guides/v2.4/graphql/mutations/move-products-between-wishlists.md b/src/guides/v2.4/graphql/mutations/move-products-between-wishlists.md index 2e7b1175e14..01e428aa648 100644 --- a/src/guides/v2.4/graphql/mutations/move-products-between-wishlists.md +++ b/src/guides/v2.4/graphql/mutations/move-products-between-wishlists.md @@ -46,7 +46,7 @@ mutation{ items { id product { - id + uid sku name } @@ -59,7 +59,7 @@ mutation{ items { id product { - id + uid sku name } @@ -87,7 +87,7 @@ mutation{ { "id": "8", "product": { - "id": 51, + "uid": "NDk=", "sku": "240-LV08", "name": "Advanced Pilates & Yoga (Strength)" } @@ -95,7 +95,7 @@ mutation{ { "id": "10", "product": { - "id": 1452, + "uid": "MTQ1MA==", "sku": "WS04", "name": "Layla Tee" } @@ -103,7 +103,7 @@ mutation{ { "id": "11", "product": { - "id": 1564, + "uid": "MTU2Mg==", "sku": "WS12", "name": "Radiant Tee" } @@ -111,7 +111,7 @@ mutation{ { "id": "12", "product": { - "id": 1612, + "uid": "MTYxMA==", "sku": "WB01", "name": "Electra Bra Top" } @@ -119,23 +119,23 @@ mutation{ { "id": "13", "product": { - "id": 1644, + "uid": "MTY0Mg==", "sku": "WB03", "name": "Celeste Sports Bra" } }, { - "id": "14", + "id": "15", "product": { - "id": 1724, + "uid": "MTcyMg==", "sku": "WT03", "name": "Nora Practice Tank" } }, { - "id": "15", + "id": "16", "product": { - "id": 1692, + "uid": "MTY5MA==", "sku": "WT01", "name": "Bella Tank" } @@ -150,7 +150,7 @@ mutation{ { "id": "1", "product": { - "id": 13, + "uid": "MTM=", "sku": "24-WB07", "name": "Overnight Duffle" } @@ -158,7 +158,7 @@ mutation{ { "id": "2", "product": { - "id": 10, + "uid": "MTA=", "sku": "24-WB05", "name": "Savvy Shoulder Tote" } @@ -166,7 +166,7 @@ mutation{ { "id": "3", "product": { - "id": 11, + "uid": "MTE=", "sku": "24-WB06", "name": "Endeavor Daytrip Backpack" } @@ -174,7 +174,7 @@ mutation{ { "id": "4", "product": { - "id": 1100, + "uid": "MTA5OA==", "sku": "WH04", "name": "Miko Pullover Hoodie" } @@ -182,7 +182,7 @@ mutation{ { "id": "5", "product": { - "id": 1228, + "uid": "MTIyNg==", "sku": "WJ01", "name": "Stellar Solar Jacket" } @@ -190,7 +190,7 @@ mutation{ { "id": "6", "product": { - "id": 1724, + "uid": "MTcyMg==", "sku": "WT03", "name": "Nora Practice Tank" } @@ -198,15 +198,15 @@ mutation{ { "id": "7", "product": { - "id": 1692, + "uid": "MTY5MA==", "sku": "WT01", "name": "Bella Tank" } }, { - "id": "16", + "id": "17", "product": { - "id": 18, + "uid": "MTg=", "sku": "24-UG02", "name": "Pursuit Lumaflex™ Tone Band" } @@ -237,7 +237,7 @@ The WishlistItemMoveInput object contains the following attributes. Attribute | Data Type | Description --- | --- | --- `quantity` | Float | The quantity of this item to move to the destination wish list. This value cannot be greater than the quantity in the source wish list -`wishlist_item_id` | ID! | The ID of the item to be moved +`wishlist_item_id` | ID! | The unique ID of the `WishlistItemInterface` item to be moved ## Output attributes diff --git a/src/guides/v2.4/graphql/mutations/remove-products-from-wishlist.md b/src/guides/v2.4/graphql/mutations/remove-products-from-wishlist.md index 89e51b497f8..651fda4e8dd 100644 --- a/src/guides/v2.4/graphql/mutations/remove-products-from-wishlist.md +++ b/src/guides/v2.4/graphql/mutations/remove-products-from-wishlist.md @@ -9,7 +9,16 @@ This mutation requires a valid [customer authentication token]({{page.baseurl}}/ ## Syntax -`mutation: removeProductsFromWishlist(wishlistId: ID! wishlistItemsIds: [ID!]!): RemoveProductsFromWishlistOutput` +```graphql +mutation { + removeProductsFromWishlist( + wishlistId: ID! + wishlistItemsIds: [ID!]! + ) { + RemoveProductsFromWishlistOutput + } +} + ``` ## Example usage @@ -20,31 +29,33 @@ The following example removes an item that was added in the [`addProductsToWishl ``` graphql mutation { removeProductsFromWishlist( - wishlistId: 1 + wishlistId: 4 wishlistItemsIds: [ - 12 + 26 ]){ wishlist { id items_count - items { - id - qty - product { - name - sku + items_v2 { + items { id - price_range { - minimum_price { - regular_price { - currency - value + quantity + product { + uid + name + sku + price_range { + minimum_price { + regular_price { + currency + value + } } - } - maximum_price { - regular_price { - currency - value + maximum_price { + regular_price { + currency + value + } } } } @@ -66,56 +77,58 @@ mutation { "data": { "removeProductsFromWishlist": { "wishlist": { - "id": "1", + "id": "4", "items_count": 2, - "items": [ - { - "id": 11, - "qty": 1, - "product": { - "name": "Sprite Yoga Companion Kit", - "sku": "24-WG080", - "id": 46, - "price_range": { - "minimum_price": { - "regular_price": { - "currency": "USD", - "value": 61 - } - }, - "maximum_price": { - "regular_price": { - "currency": "USD", - "value": 77 + "items_v2": { + "items": [ + { + "id": "27", + "quantity": 1, + "product": { + "uid": "MTIyNg==", + "name": "Stellar Solar Jacket", + "sku": "WJ01", + "price_range": { + "minimum_price": { + "regular_price": { + "currency": "USD", + "value": 75 + } + }, + "maximum_price": { + "regular_price": { + "currency": "USD", + "value": 75 + } } } } - } - }, - { - "id": 13, - "qty": 1, - "product": { - "name": "Stellar Solar Jacket", - "sku": "WJ01", - "id": 1226, - "price_range": { - "minimum_price": { - "regular_price": { - "currency": "USD", - "value": 75 - } - }, - "maximum_price": { - "regular_price": { - "currency": "USD", - "value": 75 + }, + { + "id": "28", + "quantity": 1, + "product": { + "uid": "NTI=", + "name": "Sprite Yoga Companion Kit", + "sku": "24-WG080", + "price_range": { + "minimum_price": { + "regular_price": { + "currency": "USD", + "value": 61 + } + }, + "maximum_price": { + "regular_price": { + "currency": "USD", + "value": 77 + } } } } } - } - ] + ] + } }, "user_errors": [] } diff --git a/src/guides/v2.4/graphql/mutations/update-products-in-wishlist.md b/src/guides/v2.4/graphql/mutations/update-products-in-wishlist.md index 687a8c42b4c..5addea77395 100644 --- a/src/guides/v2.4/graphql/mutations/update-products-in-wishlist.md +++ b/src/guides/v2.4/graphql/mutations/update-products-in-wishlist.md @@ -13,7 +13,16 @@ This mutation requires a valid [customer authentication token]({{page.baseurl}}/ ## Syntax -`mutation: updateProductsInWishlist(wishlistId: ID! wishlistItems: [WishlistItemUpdateInput!]!): UpdateProductsInWishlistOutput` +```graphql +mutation { + updateProductsInWishlist( + wishlistId: ID! + wishlistItems: [WishlistItemUpdateInput!]! + ){ + UpdateProductsInWishlistOutput + } +} +``` ## Example usage @@ -24,47 +33,40 @@ The following example changes the quantity of the product represented by wish li ``` graphql mutation { updateProductsInWishlist( - wishlistId: 1 + wishlistId: 2 wishlistItems: [ { - wishlist_item_id: 16 + wishlist_item_id: 10 quantity: 2 } { - wishlist_item_id: 17 + wishlist_item_id: 11 description: "I love this!" } ]){ wishlist { id items_count - items { - id - qty - product { - name - sku + items_v2 { + items { id - ... on BundleProduct { - items { - sku - options { - id - uid - } - } - } - price_range { - minimum_price { - regular_price { - currency - value + quantity + product { + name + sku + uid + price_range { + minimum_price { + regular_price { + currency + value + } } - } - maximum_price { - regular_price { - currency - value + maximum_price { + regular_price { + currency + value + } } } } @@ -86,79 +88,196 @@ mutation { "data": { "updateProductsInWishlist": { "wishlist": { - "id": "1", - "items_count": 3, - "items": [ - { - "id": 16, - "qty": 2, - "product": { - "name": "Joust Duffle Bag", - "sku": "24-MB01", - "id": 1, - "price_range": { - "minimum_price": { - "regular_price": { - "currency": "USD", - "value": 34 + "id": "2", + "items_count": 8, + "items_v2": { + "items": [ + { + "id": "8", + "quantity": 1, + "product": { + "name": "Advanced Pilates & Yoga (Strength)", + "sku": "240-LV08", + "uid": "NDk=", + "price_range": { + "minimum_price": { + "regular_price": { + "currency": "USD", + "value": 18 + } + }, + "maximum_price": { + "regular_price": { + "currency": "USD", + "value": 18 + } } - }, - "maximum_price": { - "regular_price": { - "currency": "USD", - "value": 34 + } + } + }, + { + "id": "10", + "quantity": 1, + "product": { + "name": "Layla Tee", + "sku": "WS04", + "uid": "MTQ1MA==", + "price_range": { + "minimum_price": { + "regular_price": { + "currency": "USD", + "value": 29 + } + }, + "maximum_price": { + "regular_price": { + "currency": "USD", + "value": 29 + } } } } - } - }, - { - "id": 17, - "qty": 1, - "product": { - "name": "Stellar Solar Jacket", - "sku": "WJ01", - "id": 1226, - "price_range": { - "minimum_price": { - "regular_price": { - "currency": "USD", - "value": 75 + }, + { + "id": "11", + "quantity": 1, + "product": { + "name": "Radiant Tee", + "sku": "WS12", + "uid": "MTU2Mg==", + "price_range": { + "minimum_price": { + "regular_price": { + "currency": "USD", + "value": 22 + } + }, + "maximum_price": { + "regular_price": { + "currency": "USD", + "value": 22 + } } - }, - "maximum_price": { - "regular_price": { - "currency": "USD", - "value": 75 + } + } + }, + { + "id": "12", + "quantity": 1, + "product": { + "name": "Electra Bra Top", + "sku": "WB01", + "uid": "MTYxMA==", + "price_range": { + "minimum_price": { + "regular_price": { + "currency": "USD", + "value": 39 + } + }, + "maximum_price": { + "regular_price": { + "currency": "USD", + "value": 39 + } } } } - } - }, - { - "id": 18, - "qty": 1, - "product": { - "name": "Sprite Yoga Companion Kit", - "sku": "24-WG080", - "id": 46, - "price_range": { - "minimum_price": { - "regular_price": { - "currency": "USD", - "value": 61 + }, + { + "id": "13", + "quantity": 1, + "product": { + "name": "Celeste Sports Bra", + "sku": "WB03", + "uid": "MTY0Mg==", + "price_range": { + "minimum_price": { + "regular_price": { + "currency": "USD", + "value": 39 + } + }, + "maximum_price": { + "regular_price": { + "currency": "USD", + "value": 39 + } } - }, - "maximum_price": { - "regular_price": { - "currency": "USD", - "value": 77 + } + } + }, + { + "id": "15", + "quantity": 2, + "product": { + "name": "Nora Practice Tank", + "sku": "WT03", + "uid": "MTcyMg==", + "price_range": { + "minimum_price": { + "regular_price": { + "currency": "USD", + "value": 39 + } + }, + "maximum_price": { + "regular_price": { + "currency": "USD", + "value": 39 + } + } + } + } + }, + { + "id": "24", + "quantity": 2, + "product": { + "name": "Layla Tee", + "sku": "WS04", + "uid": "MTQ1MA==", + "price_range": { + "minimum_price": { + "regular_price": { + "currency": "USD", + "value": 29 + } + }, + "maximum_price": { + "regular_price": { + "currency": "USD", + "value": 29 + } + } + } + } + }, + { + "id": "25", + "quantity": 1, + "product": { + "name": "Radiant Tee", + "sku": "WS12", + "uid": "MTU2Mg==", + "price_range": { + "minimum_price": { + "regular_price": { + "currency": "USD", + "value": 22 + } + }, + "maximum_price": { + "regular_price": { + "currency": "USD", + "value": 22 + } } } } } - } - ] + ] + } }, "user_errors": [] } diff --git a/src/guides/v2.4/graphql/mutations/update-wishlist.md b/src/guides/v2.4/graphql/mutations/update-wishlist.md index a8b8a586d67..5438f4c8af2 100644 --- a/src/guides/v2.4/graphql/mutations/update-wishlist.md +++ b/src/guides/v2.4/graphql/mutations/update-wishlist.md @@ -65,7 +65,7 @@ The `updateWishlist` mutation requires the following input. Attribute | Data Type | Description --- | --- | --- -`name` | String! | The ID of the customer's wish list +`name` | String! | The unique ID of `Wishlist` object `visibility`| WishlistVisibilityEnum! | Describes the visibility of the wish list. Possible values are `PRIVATE` and `PUBLIC` `wishlistUid` | ID! | The ID of the wish list to update diff --git a/src/guides/v2.4/graphql/queries/customer.md b/src/guides/v2.4/graphql/queries/customer.md index 78807350083..9b1736e4452 100644 --- a/src/guides/v2.4/graphql/queries/customer.md +++ b/src/guides/v2.4/graphql/queries/customer.md @@ -479,27 +479,24 @@ query { ``` ### Retrieve the customer's wish list -The following query returns the customer's wish list: +The following query returns the customer's wish lists. {{site.data.var.ee}} allows customers to have multiple wish lists. **Request:** ```graphql { customer { - wishlist { - items { - id - description - qty - product { - sku - name - price_range { - maximum_price { - regular_price { - value - } - } + wishlists { + id + name + items_count + items_v2 { + items { + id + product { + uid + name + sku } } } @@ -514,42 +511,146 @@ The following query returns the customer's wish list: { "data": { "customer": { - "wishlist": { - "items": [ - { - "id": 1, - "description": "I need this", - "qty": 1, - "product": { - "sku": "24-WG080", - "name": "Sprite Yoga Companion Kit", - "price_range": { - "maximum_price": { - "regular_price": { - "value": 77 - } + "wishlists": [ + { + "id": "1", + "name": "Vacation Wants", + "items_count": 10, + "items_v2": { + "items": [ + { + "id": "1", + "product": { + "uid": "MTM=", + "name": "Overnight Duffle", + "sku": "24-WB07" + } + }, + { + "id": "2", + "product": { + "uid": "MTA=", + "name": "Savvy Shoulder Tote", + "sku": "24-WB05" + } + }, + { + "id": "3", + "product": { + "uid": "MTE=", + "name": "Endeavor Daytrip Backpack", + "sku": "24-WB06" + } + }, + { + "id": "4", + "product": { + "uid": "MTA5OA==", + "name": "Miko Pullover Hoodie", + "sku": "WH04" + } + }, + { + "id": "5", + "product": { + "uid": "MTIyNg==", + "name": "Stellar Solar Jacket", + "sku": "WJ01" + } + }, + { + "id": "6", + "product": { + "uid": "MTcyMg==", + "name": "Nora Practice Tank", + "sku": "WT03" + } + }, + { + "id": "7", + "product": { + "uid": "MTY5MA==", + "name": "Bella Tank", + "sku": "WT01" + } + }, + { + "id": "17", + "product": { + "uid": "MTg=", + "name": "Pursuit Lumaflex™ Tone Band", + "sku": "24-UG02" + } + }, + { + "id": "18", + "product": { + "uid": "MQ==", + "name": "Joust Duffle Bag", + "sku": "24-MB01" + } + }, + { + "id": "20", + "product": { + "uid": "NTI=", + "name": "Sprite Yoga Companion Kit", + "sku": "24-WG080" } } - } - }, - { - "id": 2, - "description": null, - "qty": 1, - "product": { - "sku": "24-UG04", - "name": "Zing Jump Rope", - "price_range": { - "maximum_price": { - "regular_price": { - "value": 12 - } + ] + } + }, + { + "id": "2", + "name": "Lose the Muffintop", + "items_count": 5, + "items_v2": { + "items": [ + { + "id": "8", + "product": { + "uid": "NDk=", + "name": "Advanced Pilates & Yoga (Strength)", + "sku": "240-LV08" + } + }, + { + "id": "10", + "product": { + "uid": "MTQ1MA==", + "name": "Layla Tee", + "sku": "WS04" + } + }, + { + "id": "11", + "product": { + "uid": "MTU2Mg==", + "name": "Radiant Tee", + "sku": "WS12" + } + }, + { + "id": "12", + "product": { + "uid": "MTYxMA==", + "name": "Electra Bra Top", + "sku": "WB01" + } + }, + { + "id": "13", + "product": { + "uid": "MTY0Mg==", + "name": "Celeste Sports Bra", + "sku": "WB03" } } - } + ] } - ] - } + } + ] } } } From 46668af3b2c17b96275b085a4600672d2cbe8468 Mon Sep 17 00:00:00 2001 From: Kevin Harper Date: Sat, 5 Dec 2020 23:42:04 -0600 Subject: [PATCH 06/10] fix linting errors --- src/guides/v2.4/graphql/mutations/add-products-to-wishlist.md | 4 ++-- .../v2.4/graphql/mutations/update-products-in-wishlist.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/guides/v2.4/graphql/mutations/add-products-to-wishlist.md b/src/guides/v2.4/graphql/mutations/add-products-to-wishlist.md index e72aac9ff63..38e448b295b 100644 --- a/src/guides/v2.4/graphql/mutations/add-products-to-wishlist.md +++ b/src/guides/v2.4/graphql/mutations/add-products-to-wishlist.md @@ -17,9 +17,9 @@ To determine whether wish lists are enabled, specify the `magento_wishlist_gener ```graphql `mutation { addProductsToWishlist( - wishlistId: ID!, + wishlistId: ID!, wishlistItems: [WishlistItemInput!]! - ){ + ){ AddProductsToWishlistOutput } } diff --git a/src/guides/v2.4/graphql/mutations/update-products-in-wishlist.md b/src/guides/v2.4/graphql/mutations/update-products-in-wishlist.md index 5addea77395..2d64e15d84b 100644 --- a/src/guides/v2.4/graphql/mutations/update-products-in-wishlist.md +++ b/src/guides/v2.4/graphql/mutations/update-products-in-wishlist.md @@ -16,7 +16,7 @@ This mutation requires a valid [customer authentication token]({{page.baseurl}}/ ```graphql mutation { updateProductsInWishlist( - wishlistId: ID! + wishlistId: ID! wishlistItems: [WishlistItemUpdateInput!]! ){ UpdateProductsInWishlistOutput From ec79135bd81593dc3e1df40b6ff0706e2a90f68f Mon Sep 17 00:00:00 2001 From: Kevin Harper Date: Sat, 5 Dec 2020 23:44:33 -0600 Subject: [PATCH 07/10] I have to save my changes. Who knew? --- .../v2.4/graphql/mutations/remove-products-from-wishlist.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/guides/v2.4/graphql/mutations/remove-products-from-wishlist.md b/src/guides/v2.4/graphql/mutations/remove-products-from-wishlist.md index 651fda4e8dd..46426549b79 100644 --- a/src/guides/v2.4/graphql/mutations/remove-products-from-wishlist.md +++ b/src/guides/v2.4/graphql/mutations/remove-products-from-wishlist.md @@ -12,7 +12,7 @@ This mutation requires a valid [customer authentication token]({{page.baseurl}}/ ```graphql mutation { removeProductsFromWishlist( - wishlistId: ID! + wishlistId: ID! wishlistItemsIds: [ID!]! ) { RemoveProductsFromWishlistOutput From e9ec08a5bd07c890ae339878968bcfd6ce473b06 Mon Sep 17 00:00:00 2001 From: Kevin Harper Date: Sat, 12 Dec 2020 19:34:52 -0600 Subject: [PATCH 08/10] Incorporate dev feedback --- .../interfaces/wishlist-item-interface.md | 10 +- .../mutations/add-products-to-wishlist.md | 118 ++++++++++++------ .../copy-products-between-wishlists.md | 2 +- .../v2.4/graphql/mutations/delete-wishlist.md | 21 +++- 4 files changed, 107 insertions(+), 44 deletions(-) diff --git a/src/guides/v2.4/graphql/interfaces/wishlist-item-interface.md b/src/guides/v2.4/graphql/interfaces/wishlist-item-interface.md index eb69bfbd6f1..6fad1cad690 100644 --- a/src/guides/v2.4/graphql/interfaces/wishlist-item-interface.md +++ b/src/guides/v2.4/graphql/interfaces/wishlist-item-interface.md @@ -69,19 +69,19 @@ Attribute | Data type | Description ### GroupedProductWishlistItem attributes {#GroupedProductWishlistItem} -The GroupedProductWishlistItem data type does not extend the `WishlistItemInterface`. +The GroupedProductWishlistItem data type does not provide additional attributes to the `WishlistItemInterface`. ### SimpleWishlistItem attributes {#SimpleWishlistItem} -The SimpleWishlistItem data type does not extend the `WishlistItemInterface`. +The SimpleWishlistItem data type does not provide additional attributes to the `WishlistItemInterface`. ### VirtualWishlistItem attributes {#VirtualWishlistItem} -The VirtualWishlistItem data type does not extend the `WishlistItemInterface`. +The VirtualWishlistItem data type does not provide additional attributes to the `WishlistItemInterface`. ## Example usage -The following mutation adds a downloadable product to the cart and returns detailed information about the product. +The following mutation adds a downloadable product to a wish list and returns detailed information about the product. **Request:** @@ -107,7 +107,6 @@ mutation { updated_at items_v2 { uid - description quantity added_at ... on DownloadableWishlistItem { @@ -141,7 +140,6 @@ mutation { "items_v2": [ { "uid": "MTQ=", - "description": null, "quantity": 1, "added_at": "2020-11-12 03:01:46", "links_v2": [ diff --git a/src/guides/v2.4/graphql/mutations/add-products-to-wishlist.md b/src/guides/v2.4/graphql/mutations/add-products-to-wishlist.md index 38e448b295b..000f971de01 100644 --- a/src/guides/v2.4/graphql/mutations/add-products-to-wishlist.md +++ b/src/guides/v2.4/graphql/mutations/add-products-to-wishlist.md @@ -36,43 +36,53 @@ To determine the value of the `wishlistId` attribute, run the `customer` query a ``` graphql mutation { addProductsToWishlist( - wishlistId: 4 - wishlistItems: [ - { - sku: "24-MB01" - quantity: 1 - } - { - sku: "WG-09" - quantity: 1 - } - { - parent_sku: "WJ01" - sku: "WJ01-M-Red" - quantity: 1 - } - { - sku: "24-WG080" - quantity: 1 - selected_options: [ - "YnVuZGxlLzEvMS8x" - "YnVuZGxlLzIvNC8x" - "YnVuZGxlLzMvNy8x" - "YnVuZGxlLzQvOC8x" - ] - } - ]){ + wishlistId: 4 + wishlistItems: [ + { + sku: "24-MB01" + quantity: 1 + } + { + sku: "WG-09" + quantity: 1 + } + { + parent_sku: "WJ01" + sku: "WJ01-M-Red" + quantity: 1 + } + { + sku: "24-WG080" + quantity: 1 + selected_options: [ + "YnVuZGxlLzEvMS8x" + "YnVuZGxlLzIvNC8x" + "YnVuZGxlLzMvNy8x" + "YnVuZGxlLzQvOC8x" + ] + } + ] + ) { wishlist { id items_count - items_v2 { + items_v2 (currentPage: 1, pageSize: 8 ) { items { id quantity + ... on BundleWishlistItem { + bundle_options { + values { + id + label + quantity + } + } + } product { + uid name sku - uid price_range { minimum_price { regular_price { @@ -87,9 +97,9 @@ mutation { } } } + } } } - } } user_errors { code @@ -111,12 +121,12 @@ mutation { "items_v2": { "items": [ { - "id": "26", + "id": "20", "quantity": 1, "product": { + "uid": "MQ==", "name": "Joust Duffle Bag", "sku": "24-MB01", - "uid": "MQ==", "price_range": { "minimum_price": { "regular_price": { @@ -134,12 +144,12 @@ mutation { } }, { - "id": "27", + "id": "21", "quantity": 1, "product": { + "uid": "MTIyNg==", "name": "Stellar Solar Jacket", "sku": "WJ01", - "uid": "MTIyNg==", "price_range": { "minimum_price": { "regular_price": { @@ -157,12 +167,50 @@ mutation { } }, { - "id": "28", + "id": "22", "quantity": 1, + "bundle_options": [ + { + "values": [ + { + "id": 1, + "label": "Sprite Stasis Ball 55 cm", + "quantity": 1 + } + ] + }, + { + "values": [ + { + "id": 4, + "label": "Sprite Foam Yoga Brick", + "quantity": 1 + } + ] + }, + { + "values": [ + { + "id": 7, + "label": "Sprite Yoga Strap 10 foot", + "quantity": 1 + } + ] + }, + { + "values": [ + { + "id": 8, + "label": "Sprite Foam Roller", + "quantity": 1 + } + ] + } + ], "product": { + "uid": "NTI=", "name": "Sprite Yoga Companion Kit", "sku": "24-WG080", - "uid": "NTI=", "price_range": { "minimum_price": { "regular_price": { diff --git a/src/guides/v2.4/graphql/mutations/copy-products-between-wishlists.md b/src/guides/v2.4/graphql/mutations/copy-products-between-wishlists.md index 9c9d2d167ac..0fe21ace173 100644 --- a/src/guides/v2.4/graphql/mutations/copy-products-between-wishlists.md +++ b/src/guides/v2.4/graphql/mutations/copy-products-between-wishlists.md @@ -148,7 +148,7 @@ mutation{ ## Input attributes -The `copyProductsToWishlist` mutation requires the following input. +The `copyProductsBetweenWishlists` mutation requires the following input. Attribute | Data Type | Description --- | --- | --- diff --git a/src/guides/v2.4/graphql/mutations/delete-wishlist.md b/src/guides/v2.4/graphql/mutations/delete-wishlist.md index 3d18f2a2f15..dcbb32d93cb 100644 --- a/src/guides/v2.4/graphql/mutations/delete-wishlist.md +++ b/src/guides/v2.4/graphql/mutations/delete-wishlist.md @@ -24,8 +24,13 @@ The following example deletes a wish list. ``` graphql mutation{ - deleteWishlist(wishlistId: 5){ + deleteWishlist(wishlistId: 3){ status + wishlists { + id + name + items_count + } } } ``` @@ -36,7 +41,19 @@ mutation{ { "data": { "deleteWishlist": { - "status": true + "status": true, + "wishlists": [ + { + "id": "1", + "name": "Vacation Wants", + "items_count": 7 + }, + { + "id": "2", + "name": "Lose the Muffintop", + "items_count": 6 + } + ] } } } From cb4a0f659b9c282ac488cbcd5bed071dc32698ca Mon Sep 17 00:00:00 2001 From: Kevin Harper Date: Sat, 12 Dec 2020 19:38:42 -0600 Subject: [PATCH 09/10] linting --- src/guides/v2.4/graphql/mutations/add-products-to-wishlist.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/guides/v2.4/graphql/mutations/add-products-to-wishlist.md b/src/guides/v2.4/graphql/mutations/add-products-to-wishlist.md index 000f971de01..881e2359c79 100644 --- a/src/guides/v2.4/graphql/mutations/add-products-to-wishlist.md +++ b/src/guides/v2.4/graphql/mutations/add-products-to-wishlist.md @@ -40,7 +40,7 @@ mutation { wishlistItems: [ { sku: "24-MB01" - quantity: 1 + quantity: 1 } { sku: "WG-09" From 57fd7a0582c475161685b22d403b85fa88380969 Mon Sep 17 00:00:00 2001 From: Kevin Harper Date: Tue, 22 Dec 2020 11:47:53 -0600 Subject: [PATCH 10/10] fix merge conflict --- src/guides/v2.4/release-notes/commerce-2-4-2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/guides/v2.4/release-notes/commerce-2-4-2.md b/src/guides/v2.4/release-notes/commerce-2-4-2.md index cb28e661b97..c996893f273 100644 --- a/src/guides/v2.4/release-notes/commerce-2-4-2.md +++ b/src/guides/v2.4/release-notes/commerce-2-4-2.md @@ -88,7 +88,7 @@ This release adds GraphQL coverage for the following features: * Added the `staging` attribute to the [`ProductInterface`]({{ page.baseurl }}/graphql/interfaces/product-interface.html) and [`CategoryInterface`]({{ page.baseurl }}/graphql/interfaces/category-interface.html) to determine if a product is staged and to view its associated campaign information. -* Added support for multiple wish lists. You can use GraphQL to [create]({{ page.baseurl }}/graphql/mutations/create-wishlist.html), [delete]({{ page.baseurl }}/graphql/mutations/delete-wishlist.html), and [rename]({{ page.baseurl }}/graphql/mutations/update-wishlist.html) wish lists as well as [move]({{ page.baseurl }}/graphql/mutations/move-products-to-wishlist.html) or [copy]({{ page.baseurl }}/graphql/mutations/copy-products-to-wishlist.html) items between them. +* Added support for multiple wish lists. You can use GraphQL to [create]({{ page.baseurl }}/graphql/mutations/create-wishlist.html), [delete]({{ page.baseurl }}/graphql/mutations/delete-wishlist.html), and [rename]({{ page.baseurl }}/graphql/mutations/update-wishlist.html) wish lists as well as [move]({{ page.baseurl }}/graphql/mutations/move-products-between-wishlists.html) or [copy]({{ page.baseurl }}/graphql/mutations/copy-products-between-wishlists.html) items between them. * Added support for returned merchandise authorizations (RMA)