Category Object
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!
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
}
Interfaces
Fields
id
id · ID!
The ID of the category.
privateMetadata
privateMetadata · [MetadataItem!]!
List of private metadata items. Requires staff permissions to access.
privateMetafield
privateMetafield · String
A single key from private metadata. Requires staff permissions to access.
Tip: Use GraphQL aliases to fetch multiple keys.
key
key · String!
privateMetafields
privateMetafields · Metadata
Private metadata. Requires staff permissions to access. Use keys to control which fields you want to include. The default is to include everything.
keys
keys · [String!]
metadata
metadata · [MetadataItem!]!
List of public metadata items. Can be accessed without permissions.
metafield
metafield · String
A single key from public metadata.
Tip: Use GraphQL aliases to fetch multiple keys.
key
key · String!
metafields
metafields · Metadata
Public metadata. Use keys to control which fields you want to include. The default is to include everything.
keys
keys · [String!]
seoTitle
seoTitle · String
SEO title of category.
seoDescription
seoDescription · String
SEO description of category.
name
name · String!
Name of category
description
description · JSONString
Description of the category.
Rich text format. For reference see https://editorjs.io/
fullDescription
fullDescription · JSONString
Full description of the category. Returns null when unset.
Rich text format. For reference see https://editorjs.io/
Added in Saleor 3.23slug
slug · String!
Slug of the category.
externalReference
externalReference · String
External ID of this category.
Added in Saleor 3.23parent
parent · Category
Parent category.
level
level · Int!
Level of the category.
descriptionJson
descriptionJson · JSONString
Description of the category.
Rich text format. For reference see https://editorjs.io/
updatedAt
updatedAt · DateTime!
The date and time when the category was last updated.
ancestors
ancestors · CategoryCountableConnection
List of ancestors of the category.
before
before · String
Return the elements in the list that come before the specified cursor.
after
after · String
Return the elements in the list that come after the specified cursor.
first
first · Int
Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.
last
last · Int
Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.
products
products · ProductCountableConnection
List of products in the category.
filter
filter · ProductFilterInput
Filtering options for products.
where
where · ProductWhereInput
Where filtering options for products.
sortBy
sortBy · ProductOrder
Sort products.
search
search · String
Search products.
channel
channel · String
Slug of a channel for which the data should be returned.
before
before · String
Return the elements in the list that come before the specified cursor.
after
after · String
Return the elements in the list that come after the specified cursor.
first
first · Int
Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.
last
last · Int
Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.
children
children · CategoryCountableConnection
List of children of the category.
before
before · String
Return the elements in the list that come before the specified cursor.
after
after · String
Return the elements in the list that come after the specified cursor.
first
first · Int
Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.
last
last · Int
Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.
backgroundImage
backgroundImage · Image
Background image of the category.
size
size · Int
Desired longest side the image in pixels. Defaults to 4096. Images are never cropped. Pass 0 to retrieve the original size (not recommended). Thumbnails are generated only in the available sizes: 32, 64, 128, 256, 512, 1024, 2048, 4096; sizeRounding determines which one is used.
sizeRounding
sizeRounding · ThumbnailSizeRoundingEnum
Determines how the requested size is matched to an available thumbnail size.
Added in Saleor 3.23Default: NEAREST.
format
format · ThumbnailFormatEnum
The format of the image. When not provided, format of the original image will be used.
Default: ORIGINAL.
translation
translation · CategoryTranslation
Returns translated category fields for the given language code.
languageCode
languageCode · LanguageCodeEnum!
A language code to return the translation for category.
Used by
- AssignedMultiCategoryReferenceAttribute (objects)
- AssignedSingleCategoryReferenceAttribute (objects)
- MenuItem (objects)
- _Entity (unions)
- CategoryCountableEdge (objects)
- CategoryCreate (objects)
- CategoryCreated (objects)
- CategoryDelete (objects)
- CategoryDeleted (objects)
- CategoryTranslatableContent (objects)
- CategoryTranslate (objects)
- CategoryUpdate (objects)
- CategoryUpdated (objects)
- Product (objects)
- ProductCreated (objects)
- ProductDeleted (objects)
- ProductMetadataUpdated (objects)
- ProductUpdated (objects)
- category (queries)
Schema: Saleor 3.23.43. Download SDL.