Skip to content

A product category in the LCBO hierarchy

graphql
type Category {
  id: String!
  name: String!
  slug: String!
  path: String!
  depth: Int!
  rootType: String
  sortOrder: Int
  productsCount: Int
  childrenCount: Int
  parentCategoryId: Int
  products(
    pagination: PaginationInput
    sortBy: ProductSortField
    sortDirection: SortDirection
  ): ProductConnection!
  parent: Category
  children(
    pagination: PaginationInput
    sortBy: CategorySortField
    sortDirection: SortDirection
  ): CategoryConnection!
}

Fields ​

Category.id ● String! non-null scalar ​

Category.name ● String! non-null scalar ​

Category.slug ● String! non-null scalar ​

URL-friendly identifier for the category (e.g., "red-wine")

Category.path ● String! non-null scalar ​

Full hierarchical path to the category (e.g., "wine/red-wine")

Category.depth ● Int! non-null scalar ​

Depth in the category hierarchy (0 = root)

Category.rootType ● String scalar ​

The root category type (Collections, Products, etc.)

Category.sortOrder ● Int scalar ​

Category.productsCount ● Int scalar ​

Category.childrenCount ● Int scalar ​

Number of direct child categories (computed field)

Category.parentCategoryId ● Int scalar ​

Category.products ● ProductConnection! non-null object ​

Get products in this category with optional filtering, pagination, and sorting

Category.products.pagination ● PaginationInput input ​
Category.products.sortBy ● ProductSortField enum ​
Category.products.sortDirection ● SortDirection enum ​

Category.parent ● Category object ​

Get the parent category

Category.children ● CategoryConnection! non-null object ​

Get child categories with optional pagination and sorting

Category.children.pagination ● PaginationInput input ​
Category.children.sortBy ● CategorySortField enum ​
Category.children.sortDirection ● SortDirection enum ​

Returned By ​

category query

Member Of ​

Category object ● CategoryEdge object ● Product object