Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 5753ff6

Browse files
authored
Merge pull request #3758 from magento/em_magento-graphql3341
Create GraphQL Topic for Wish List Endpoint
2 parents 8234c28 + 36c572d commit 5753ff6

File tree

2 files changed

+103
-0
lines changed

2 files changed

+103
-0
lines changed

_data/toc/graphql.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,6 @@ pages:
7979

8080
- label: urlResolver endpoint
8181
url: /graphql/reference/url-resolver.html
82+
83+
- label: Wishlist endpoint
84+
url: /graphql/reference/wishlist.html
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
group: graphql
3+
title: Wishlist endpoint
4+
---
5+
6+
The Wishlist endpoint defines the contents of a customer's wish list.
7+
8+
## Query
9+
Use Wishlist queries to retrieve information about a customer's wish list.
10+
11+
### Wish list attributes
12+
13+
Attribute | Data type | Description
14+
--- | --- | ---
15+
`items` | [Wishlistitem](#wishlistitem) | An array of items in the customer's wish list
16+
`items_count` | Int | The number of items in the wish list
17+
`name` | String | When multiple wish lists are enabled, the name the customer assigns to the wish list
18+
`sharing_code` | String | An encrypted code that Magento uses to link to the wish list
19+
`updated_at` | String | The time of the last modification to the wish list
20+
21+
### Wish list item attributes {#wishlistitem}
22+
23+
Attribute | Data type | Description
24+
--- | --- | ---
25+
`added_at` | String | The time when the customer added the item to the wish list
26+
`description` | String | The customer's comment about this item
27+
`id` | Int | The wish list item ID
28+
`product` | <a href="{{ page.baseurl }}/graphql/reference/products.html#ProductInterface">ProductInterface</a> | The ProductInterface contains attributes that are common to all types of products. Note that descriptions may not be available for custom and EAV attributes
29+
`qty` | Float | The quantity of this wish list item
30+
31+
## Syntax
32+
33+
`wishlist: WishlistOutput`
34+
35+
## Example usage
36+
37+
The following query returns the customer's wish list:
38+
39+
**Request**
40+
41+
```
42+
{
43+
wishlist {
44+
items_count
45+
name
46+
sharing_code
47+
updated_at
48+
items {
49+
id
50+
qty
51+
description
52+
added_at
53+
product {
54+
sku
55+
name
56+
}
57+
}
58+
}
59+
}
60+
```
61+
62+
**Response**
63+
64+
```json
65+
{
66+
"data": {
67+
"wishlist": {
68+
"items_count": 2,
69+
"name": "Wish List",
70+
"sharing_code": "KAXDj0HlM7Y2s58mllsVhSJvRj4fWIZj",
71+
"updated_at": "2019-02-13 22:47:45",
72+
"items": [
73+
{
74+
"id": 1,
75+
"qty": 1,
76+
"description": "My first priority",
77+
"added_at": "2019-02-20 14:38:02",
78+
"product": {
79+
"sku": "MJ09",
80+
"name": "Taurus Elements Shell"
81+
}
82+
},
83+
{
84+
"id": 2,
85+
"qty": 1,
86+
"description": null,
87+
"added_at": "2019-02-20 14:38:28",
88+
"product": {
89+
"sku": "MSH11",
90+
"name": "Arcadio Gym Short"
91+
}
92+
}
93+
]
94+
}
95+
}
96+
}
97+
```
98+
## Mutations
99+
100+
Wish list mutations will be added in a future release.

0 commit comments

Comments
 (0)