Skip to main content

Fetch favorite lists with products

Retrieve the user's favorite (wish) lists with their products.

Query

query GetFavoriteLists($offset: Int, $page: Int) {
favoriteLists(input: { offset: $offset, page: $page }) {
items {
id
name
isDefault
slug
createdAt
products(input: { offset: 5 }) {
items {
... on Product {
productId
names(language: "NL") { value }
sku
}
}
itemsFound
}
}
itemsFound
}
}

Variables

{
"offset": 10,
"page": 1
}

Response

{
"data": {
"favoriteLists": {
"items": [
{
"id": "66a21b15dd2e049b327c6434",
"name": "Michurin studio center",
"isDefault": false,
"slug": "michurin-studio-center",
"createdAt": "2024-07-25T09:29:57.242Z",
"products": {
"items": [
{
"productId": 39,
"names": [{ "value": "HP ProBook 450 G8 Notebook 39.6 cm Full HD Intel® Windows 10 Pro Silver" }],
"sku": "203F7EA#ABH"
}
],
"itemsFound": 1
}
},
{
"id": "66d6ab6e590599fecc3fa5a2",
"name": "IT supplies afdeling management",
"isDefault": false,
"slug": "it-supplies-afdeling-management",
"createdAt": "2024-09-03T06:23:42.983Z",
"products": {
"items": [
{
"productId": 41,
"names": [{ "value": "Acer Aspire 3 Spin Laptop A3SP14-31PT | Zilver" }],
"sku": "NX.KENEH.007"
},
{
"productId": 44,
"names": [{ "value": "Logitech MX Mechanical Wireless Keyboard + Logitech MX Master 3S" }],
"sku": "908468"
}
],
"itemsFound": 5
}
}
],
"itemsFound": 18
}
}
}

How it works

Favorite lists are scoped to the authenticated user's contact or company. Each list has a nested products connection that supports its own pagination via the input argument. The isDefault field indicates which list is the primary one. Products inside favorite lists are returned as the Product union type, so use an inline fragment (... on Product) to access product fields. Lists can also contain clusters — use ... on Cluster for those.

See also