Category
ObjectRepresents a category, encapsulating all information required to display and manage categories across storefronts and sales channels.
Each category includes core details such as title, description, and associated products. Categories can be organized hierarchically to create a structured navigation experience for customers.
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 ID of the category.
- Int!
level The level of the category. Root categories have a level of 0, their direct children have a level of 1, and so on.
- [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 The path associated with this category.
- ProductVariantConnection!
productVariants A paged list of product variants whose products are associated with the category.
- ProductsConnection!
products List of products in the collection.
- 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.
Gets a single
Categoryby its ID, slug, or site path.