Skip to main content

collection Query

Description​

Retrieves a collection with its first page of items.

query collection(
$handle: String
$id: Int
$page: Int
$limit: Int
$order: Int
$sort: String
$randomise: Boolean
) {
collection(
handle: $handle
id: $id
page: $page
limit: $limit
order: $order
sort: $sort
randomise: $randomise
) {
collection {
_id
id
title
handle
viewType
path
}
}
}

Variables​

{
"handle": "handle",
"id": 1986701184495,
"page": 1,
"limit": 20,
"order": -1,
"sort": "sort",
"randomise": true
}

Response​

{
"collection": {
"collection": {
"_id": "143f16fe9c31548fc08c95cf",
"id": 2543095934807,
"title": "example",
"handle": "example",
"viewType": "example",
"path": "/release/1763553751/release-artist-release-name"
}
}
}

Arguments​

NameTypeDescription
handleStringURL-friendly handle for the collection.
idIntNumeric identifier for the collection.
pageIntPage number to retrieve.
limitIntNumber of items per page. Your requested size is used if it does not exceed the server-enforced maximum limit.
orderIntSort order (1 for ascending, -1 for descending).
sortStringField name to sort by.
randomiseBooleanWhether to randomize the item order.

Returns​

CollectionWithData