category Query
Look up a category by ID, slug or external reference. If slugLanguageCode is provided, category will be fetched by slug translation.
category(id: ID, slug: String, slugLanguageCode: LanguageCodeEnum, externalReference: String): Category
Returns
Show return type
type Category implements Node & ObjectWithMetadata {
id: ID!
privateMetadata: [MetadataItem!]!
privateMetafield(key: String!): String
privateMetafields(keys: [String!]): Metadata
metadata: [MetadataItem!]!
metafield(key: String!): String
metafields(keys: [String!]): Metadata
seoTitle: String
seoDescription: String
name: String!
description: JSONString
fullDescription: JSONString
slug: String!
externalReference: String
parent: Category
level: Int!
descriptionJson: JSONString @deprecated(reason: "Use the `description` field instead.")
updatedAt: DateTime!
ancestors(before: String, after: String, first: Int, last: Int): CategoryCountableConnection
products(filter: ProductFilterInput @deprecated(reason: "Use `where` filter instead."), where: ProductWhereInput, sortBy: ProductOrder, search: String, channel: String, before: String, after: String, first: Int, last: Int): ProductCountableConnection
children(before: String, after: String, first: Int, last: Int): CategoryCountableConnection
backgroundImage(size: Int, sizeRounding: ThumbnailSizeRoundingEnum = NEAREST, format: ThumbnailFormatEnum = ORIGINAL): Image
translation(languageCode: LanguageCodeEnum!): CategoryTranslation
}Arguments
id
id · ID
ID of the category.
slug
slug · String
Slug of the category
slugLanguageCode
slugLanguageCode · LanguageCodeEnum
Language code of the category slug, omit to use primary slug.
Added in Saleor 3.21externalReference
externalReference · String
External ID of the category.
Added in Saleor 3.23Schema: Saleor 3.23.43. Download SDL.