Category
ObjectRepresents a grouping of products within Thor Commerce, enabling merchants to organize and showcase items across storefronts and sales channels. Categories can be defined manually or dynamically via rules based on product attributes, tags, or metadata. Each category supports hierarchical relationships, custom fields, and localization to optimize navigation and personalize the shopping experience.
Fields
- [Category!]!
ancestors The ancestors of the category.
- [Category!]!
children The direct children of the category.
- Long!
childrenCount The number of direct children of the category.
- [Category!]!
descendants The descendants of the category.
- Long!
descendantsCount The number of descendants of the category.
- ID!
id The unique identifier of the category.
- Int!
level Returns the level of the category in the category tree.
- [Metafield!]!
metafields A list of metafields associated with the category. If a metafield definition has no explicit assignment for this category, the definition’s default value is returned.
- String!
name The name of the category.
- Category
parent The parent category of the category.
- String!
path Returns the path of the category in the category tree.
- ProductConnection!
products Retrieves a paged list of products associated with the category.
- Long!
productsCount The number of products that are associated with the category.
- String!
slug The slug of the category.
Queries
Returns a list of categories.
Returns a Category by its ID, slug, or site path.
Mutations
Creates a new category
Deletes a category by its ID.
Reorders products within a category.
Updates an existing category.