Collections
A collection combines localized presentation settings with a configured game filter, sort order, pinned games, and hidden games. The API returns the resulting games; your frontend does not need to reproduce the filter logic.
Execution context: browser or platform server. A browser sends Content-Type, X-Game-Platform-ID, matching Origin, and credentials: 'include'. A server also sends X-Game-Platform-Api-Key. Keep the API key out of browser code.
List platform collections
query PlatformCollections($lang: Lang) {
result: PlatformFetchGamePlatformCollections {
__typename
... on Problem {
message
}
... on GamePlatformCollectionsList {
count
items {
id
platformId
isActive
name(lang: $lang)
description(lang: $lang)
slug(lang: $lang)
icon(lang: $lang)
cover(lang: $lang)
sort
pinnedGames
hiddenGames
}
}
}
}
Variables:
{
"lang": "EN"
}
Successful response:
{
"data": {
"result": {
"__typename": "GamePlatformCollectionsList",
"count": 1,
"items": [
{
"id": 7,
"platformId": 42,
"isActive": true,
"name": "Popular",
"description": "Games players choose most often",
"slug": "popular",
"icon": "https://cdn.example.com/popular.svg",
"cover": "https://cdn.example.com/popular.webp",
"sort": "PLAYERS_MAU",
"pinnedGames": [101],
"hiddenGames": []
}
]
}
}
}
The list can contain inactive collections. Render collection cards and create public routes only for items with isActive: true.
Load collection metadata and games
Request metadata for the route and games for the current page in one GraphQL operation. limit and offset control the game list; sort can override the collection's default order for this request.
query CollectionPage(
$collectionInput: FetchGamePlatformCollectionInput!
$gamesInput: FetchGameViewsByGamePlatformCollectionInput!
$lang: Lang
) {
result: FetchGamePlatformCollection(input: $collectionInput) {
__typename
... on Problem {
message
}
... on GamePlatformCollection {
id
isActive
name(lang: $lang)
description(lang: $lang)
slug(lang: $lang)
icon(lang: $lang)
cover(lang: $lang)
sort
seoSettings {
ogTitle(lang: $lang)
ogDescription(lang: $lang)
ogImage(lang: $lang)
}
}
}
gamesResult: FetchGameViewsByGamePlatformCollection(input: $gamesInput) {
__typename
... on Problem {
message
}
... on GameViewsList {
count
items {
id
name(lang: $lang)
description(lang: $lang)
icon(lang: $lang)
cover(lang: $lang)
platformUrl(lang: $lang)
rating
}
}
}
}
Variables:
{
"lang": "EN",
"collectionInput": {
"platformId": 42,
"collectionId": 7
},
"gamesInput": {
"gamePlatformId": 42,
"collectionId": 7,
"limit": 12,
"offset": 0,
"targetOS": "Desktop"
}
}
Successful response shape:
{
"data": {
"result": {
"__typename": "GamePlatformCollection",
"id": 7,
"isActive": true,
"name": "Popular",
"slug": "popular",
"sort": "PLAYERS_MAU"
},
"gamesResult": {
"__typename": "GameViewsList",
"count": 1,
"items": [
{
"id": 101,
"name": "Example Game",
"platformUrl": "https://games.example.com/game/example-game",
"rating": 8.4
}
]
}
}
}
Check both result and gamesResult for Problem. In GameViewsList, count is the number of items in the current response. Increase gamesInput.offset by gamesInput.limit while gamesResult.items.length equals gamesInput.limit; stop after a shorter page. Available sort values are PUBLISHED_AT_ASC, DATE, PLAYERS_MAU, ONLINE, RATING, and RELEVANCE_SIMPLE.