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!
description: String!
descriptionHtml: String!
externalId: String
externalSource: String
seoTitle: String
seoDescription: String
name: String!
slug: String!
parent: Category
allowProductAssignment: Boolean!
level: Int!
privateMetadata: [MetadataItem!]!
metadata: [MetadataItem!]!
ancestors(
before: String
after: String
first: Int
last: Int
): CategoryCountableConnection
products(
filter: ProductFilterInput
sortBy: ProductOrder
before: String
after: String
first: Int
last: Int
): ProductCountableConnection
children(
before: String
after: String
first: Int
last: Int
): CategoryCountableConnection
backgroundImage(
size: Int
): Image
trailingBreadcrumbs: [Category!]
customFields: [SelectedAttribute!]!
}
Show more ↓

Fields

Category.id ● ID! non-null scalar

The ID of the object

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.parent ● Category object

Category.allowProductAssignment ● Boolean! non-null scalar

Category.level ● Int! non-null scalar

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

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

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

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

Category.ancestors ● CategoryCountableConnection object

List of ancestors of the category.

Category.ancestors.before ● String scalar

Return the elements in the list that come before the specified cursor.

Category.ancestors.after ● String scalar

Return the elements in the list that come after the specified cursor.

Category.ancestors.first ● Int scalar

Return the first n elements from the list.

Category.ancestors.last ● Int scalar

Return the last n elements from the list.

Category.products ● ProductCountableConnection 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

Filtering options for products.

Category.products.sortBy ● ProductOrder input

Sort products.

Category.products.before ● String scalar

Return the elements in the list that come before the specified cursor.

Category.products.after ● String scalar

Return the elements in the list that come after the specified cursor.

Category.products.first ● Int scalar

Return the first n elements from the list.

Category.products.last ● Int scalar

Return the last n elements from the list.

Category.children ● CategoryCountableConnection object

List of children of the category.

Category.children.before ● String scalar

Return the elements in the list that come before the specified cursor.

Category.children.after ● String scalar

Return the elements in the list that come after the specified cursor.

Category.children.first ● Int scalar

Return the first n elements from the list.

Category.children.last ● Int scalar

Return the last n elements from the list.

Category.backgroundImage ● Image object

Category.backgroundImage.size ● Int scalar

Size of the image.

Category.trailingBreadcrumbs ● [Category!] list object

List providing entire parent-to-child lineage of categories leading to current category

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

List of custom fields assigned to this category.

Interfaces

Node interface

An object with an ID

ObjectWithMetadata interface

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?