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": 8756435107988,
"page": 1,
"limit": 20,
"order": 42,
"sort": "sort",
"randomise": true
}

Response

{
"collection": {
"collection": {
"_id": "915610f7c85ab95ca36d45dc",
"id": 8116952002469,
"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