Skip to Content
StoreOSv0.27.1
Storefront GraphQL APIReferenceQueries

Collection

QUERYcollection(id: String!): StorefrontCollection

Arguments

id*String!

Returns

  1. collection
_id*ID!
logo?
name?String
slug?String

URL handle used in storefront links (/collections/{slug})

description?String
parentCategory?ID

Parent collection ID for subcollection hierarchy

level?Int

Depth level in the hierarchy

sortOrder?Int

Position among sibling collections (ascending). Ties sort by name.

children?

Child subcollections (populated via virtual)

tenant?String
createdAt?DateTime

A date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date-time format.

updatedAt?DateTime

A date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date-time format.

Example Request
query Collection($id: String!) {  collection(id: $id) {    _id    logo {      fileAssetId      provider      key      external      alt    }    name    slug    description    parentCategory    level    sortOrder    children {      _id      logo {        fileAssetId        provider        key        external        alt      }      name      slug      description      parentCategory      level      sortOrder      children {        _id        name        slug        description        parentCategory        level        sortOrder        isDemo      }      isDemo    }    tenant  }}
Variables
{  "id": "string"}
Example Response
{  "data": {    "collection": {      "_id": "1",      "logo": {        "fileAssetId": "1",        "provider": "CLOUDINARY",        "key": "string",        "external": "string",        "alt": "string"      },      "name": "string",      "slug": "string",      "description": "string",      "parentCategory": "1",      "level": 10,      "sortOrder": 10,      "children": [        {          "_id": "1",          "logo": {            "fileAssetId": "1",            "provider": "CLOUDINARY",            "key": "string",            "external": "string",            "alt": "string"          },          "name": "string",          "slug": "string",          "description": "string",          "parentCategory": "1",          "level": 10,          "sortOrder": 10,          "children": [            {              "_id": "1",              "name": "string",              "slug": "string",              "description": "string",              "parentCategory": "1",              "level": 10,              "sortOrder": 10,              "isDemo": true            }          ],          "isDemo": true        }      ],      "tenant": "string"    }  }}