Skip to main content

Category

Represents a single category of products. Categories allow to organize products in a tree-hierarchies which can be used for navigation in the storefront.

type Category implements Node, ObjectWithMetadata {
id: ID!
metadata: [MetadataItem!]!
privateMetadata: [MetadataItem!]!
description: String!
descriptionHtml: String!
externalId: String
externalSource: String
seoTitle: String
seoDescription: String
name: String!
slug: String!
allowProductAssignment: Boolean!
level: Int!
backgroundImage(
size: Int
): Image
parent: Category
ancestors(
before: String
after: String
first: Int
last: Int
): CategoryCountableConnection!
children(
before: String
after: String
first: Int
last: Int
): CategoryCountableConnection!
trailingBreadcrumbs: [Category!]!
customFields: [SelectedAttribute!]!
products(
filter: ProductFilterInput
sortBy: ProductOrder
before: String
after: String
first: Int
last: Int
): ProductCountableConnection!
}
Show more ↓

Fields

Category.id ● ID! non-null scalar

The Globally Unique ID of this object

Category.metadata ● [MetadataItem!]! non-null object

List of public metadata items. Can be accessed without permissions.

Category.privateMetadata ● [MetadataItem!]! non-null object

List of private metadata items. Requires proper staff permissions to access.

Category.description ● String! non-null scalar

Category.descriptionHtml ● String! non-null scalar

Category.externalId ● String scalar

Category.externalSource ● String scalar

Category.seoTitle ● String scalar

Category.seoDescription ● String scalar

Category.name ● String! non-null scalar

Category.slug ● String! non-null scalar

Category.allowProductAssignment ● Boolean! non-null scalar

Category.level ● Int! non-null scalar

Category.backgroundImage ● Image object

Background image for the category

Category.backgroundImage.size ● Int scalar

Category.parent ● Category object

Parent category, if any

Category.ancestors ● CategoryCountableConnection! non-null object

List of ancestor categories (from root to parent)

Category.ancestors.before ● String scalar

Returns the items in the list that come before the specified cursor.

Category.ancestors.after ● String scalar

Returns the items in the list that come after the specified cursor.

Category.ancestors.first ● Int scalar

Returns the first n items from the list.

Category.ancestors.last ● Int scalar

Returns the items in the list that come after the specified cursor.

Category.children ● CategoryCountableConnection! non-null object

List of direct child categories

Category.children.before ● String scalar

Returns the items in the list that come before the specified cursor.

Category.children.after ● String scalar

Returns the items in the list that come after the specified cursor.

Category.children.first ● Int scalar

Returns the first n items from the list.

Category.children.last ● Int scalar

Returns the items in the list that come after the specified cursor.

Category.trailingBreadcrumbs ● [Category!]! non-null object

Full breadcrumb trail from root to this category (inclusive)

Category.customFields ● [SelectedAttribute!]! non-null object

Custom fields assigned to this category

Category.products ● ProductCountableConnection! non-null object

List of products in the category and ancestor categories. This information preferable to request only for a single category details query.

Category.products.filter ● ProductFilterInput input
Category.products.sortBy ● ProductOrder input
Category.products.before ● String scalar

Returns the items in the list that come before the specified cursor.

Category.products.after ● String scalar

Returns the items in the list that come after the specified cursor.

Category.products.first ● Int scalar

Returns the first n items from the list.

Category.products.last ● Int scalar

Returns the items in the list that come after the specified cursor.

Interfaces

Node interface

An object with a Globally Unique ID

ObjectWithMetadata interface

An object that supports metadata.

Returned By

allCategories query ● category query

Member Of

AgreementCommission object ● Category object ● CategoryCountableEdge object ● CategoryCreate object ● CategoryDelete object ● CategoryUpdate object ● MenuItem object ● Product object ● ProductCategoryReportType object

Implemented By

CustomFieldInstance union

Was this page helpful?