Skip to main content

⚠️ Deprecated: Use inventoryItems instead

collectionData Query

Description

Retrieves paginated items from a collection segment.

query collectionData(
$segment: JSON!
$page: Int
$limit: Int
$sort: String
$order: Int
$randomise: Boolean
) {
collectionData(
segment: $segment
page: $page
limit: $limit
sort: $sort
order: $order
randomise: $randomise
) {
pagination {
limit
count
page
pages
hasMore
}
items {
_id
id
type
incId
uniqueId
oldId
created
modified
isForbiddenForSale
handle
path
uri
wants
bitly
}
}
}

Variables

{
"segment": {},
"page": 1,
"limit": 20,
"sort": "sort",
"order": 42,
"randomise": true
}

Response

{
"collectionData": {
"pagination": {
"limit": 20,
"count": 10,
"page": 1,
"pages": 1,
"hasMore": true
},
"items": [
{
"_id": "168d7995527b0d6b1296b34e",
"id": 1.23,
"type": "ReleaseItem",
"incId": 1.23,
"uniqueId": "example",
"oldId": 1.23,
"created": 1708953375093,
"modified": 1737966691021,
"isForbiddenForSale": true,
"handle": "example",
"path": "/release/1763553751/release-artist-release-name",
"uri": "https://www.my-common-ground-store.com/release/1763553751/release-artist-release-name",
"wants": 42,
"bitly": "example"
}
]
}
}

Arguments

NameTypeDescription
segmentJSON!JSON object specifying the segment criteria
pageIntPage number to retrieve
limitIntNumber of items per page. You can request a specific page size, and it will be used if it does not exceed the server-enforced maximum. If your requested size exceeds the maximum, the server will enforce the maximum limit.
sortStringField name to sort items by
orderIntSort order: 1 for ascending, -1 for descending
randomiseBooleanWhether to randomize the item order

Returns

CollectionData