> Documentation index: [Saleor](/llms.txt) · [This section](/api-reference/products/llms.txt)
> Source: https://docs.saleor.io/api-reference/products/objects/category

# 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.

```graphql
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
  slug: String!
  parent: Category
  level: Int!
  descriptionJson: JSONString @deprecated
  updatedAt: DateTime!
  ancestors(
    before: String
    after: String
    first: Int
    last: Int
  ): CategoryCountableConnection
  products(
    filter: ProductFilterInput
    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
    format: ThumbnailFormatEnum = ORIGINAL
  ): Image
  translation(
    languageCode: LanguageCodeEnum!
  ): CategoryTranslation
}
```

<a id="fields"></a>

### Fields

<a id="id"></a>

#### [`id`](#id) ● [`ID!`](/api-reference/miscellaneous/scalars/id.md)

The ID of the category.

<a id="private-metadata"></a>

#### [`privateMetadata`](#private-metadata) ● [`[MetadataItem!]!`](/api-reference/miscellaneous/objects/metadata-item.md)

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

<a id="private-metafield"></a>

#### [`privateMetafield`](#private-metafield) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

A single key from private metadata. Requires staff permissions to access.

Tip: Use GraphQL aliases to fetch multiple keys.

<a id="category-private-metafield-key"></a>

##### [`key`](#category-private-metafield-key) ● [`String!`](/api-reference/miscellaneous/scalars/string.md)

<a id="private-metafields"></a>

#### [`privateMetafields`](#private-metafields) ● [`Metadata`](/api-reference/miscellaneous/scalars/metadata.md)

Private metadata. Requires staff permissions to access. Use `keys` to control which fields you want to include. The default is to include everything.

<a id="category-private-metafields-keys"></a>

##### [`keys`](#category-private-metafields-keys) ● [`[String!]`](/api-reference/miscellaneous/scalars/string.md)

<a id="metadata"></a>

#### [`metadata`](#metadata) ● [`[MetadataItem!]!`](/api-reference/miscellaneous/objects/metadata-item.md)

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

<a id="metafield"></a>

#### [`metafield`](#metafield) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

A single key from public metadata.

Tip: Use GraphQL aliases to fetch multiple keys.

<a id="category-metafield-key"></a>

##### [`key`](#category-metafield-key) ● [`String!`](/api-reference/miscellaneous/scalars/string.md)

<a id="metafields"></a>

#### [`metafields`](#metafields) ● [`Metadata`](/api-reference/miscellaneous/scalars/metadata.md)

Public metadata. Use `keys` to control which fields you want to include. The default is to include everything.

<a id="category-metafields-keys"></a>

##### [`keys`](#category-metafields-keys) ● [`[String!]`](/api-reference/miscellaneous/scalars/string.md)

<a id="seo-title"></a>

#### [`seoTitle`](#seo-title) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

SEO title of category.

<a id="seo-description"></a>

#### [`seoDescription`](#seo-description) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

SEO description of category.

<a id="name"></a>

#### [`name`](#name) ● [`String!`](/api-reference/miscellaneous/scalars/string.md)

Name of category

<a id="description"></a>

#### [`description`](#description) ● [`JSONString`](/api-reference/miscellaneous/scalars/jsonstring.md)

Description of the category.

Rich text format. For reference see [https://editorjs.io/](https://editorjs.io/)

<a id="slug"></a>

#### [`slug`](#slug) ● [`String!`](/api-reference/miscellaneous/scalars/string.md)

Slug of the category.

<a id="parent"></a>

#### [`parent`](#parent) ● [`Category`](/api-reference/products/objects/category.md)

Parent category.

<a id="level"></a>

#### [`level`](#level) ● [`Int!`](/api-reference/miscellaneous/scalars/int.md)

Level of the category.

<a id="updated-at"></a>

#### [`updatedAt`](#updated-at) ● [`DateTime!`](/api-reference/miscellaneous/scalars/date-time.md)

The date and time when the category was last updated.

<a id="ancestors"></a>

#### [`ancestors`](#ancestors) ● [`CategoryCountableConnection`](/api-reference/products/objects/category-countable-connection.md)

List of ancestors of the category.

<a id="category-ancestors-before"></a>

##### [`before`](#category-ancestors-before) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

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

<a id="category-ancestors-after"></a>

##### [`after`](#category-ancestors-after) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

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

<a id="category-ancestors-first"></a>

##### [`first`](#category-ancestors-first) ● [`Int`](/api-reference/miscellaneous/scalars/int.md)

Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

<a id="category-ancestors-last"></a>

##### [`last`](#category-ancestors-last) ● [`Int`](/api-reference/miscellaneous/scalars/int.md)

Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

<a id="products"></a>

#### [`products`](#products) ● [`ProductCountableConnection`](/api-reference/products/objects/product-countable-connection.md)

List of products in the category.

Requires the following permissions to include the unpublished items: MANAGE\_ORDERS MANAGE\_DISCOUNTS MANAGE\_PRODUCTS

<a id="category-products-filter"></a>

##### [`filter`](#category-products-filter) ● [`ProductFilterInput`](/api-reference/products/inputs/product-filter-input.md)

DEPRECATED

Use `where` filter instead.

Filtering options for products.

<a id="category-products-where"></a>

##### [`where`](#category-products-where) ● [`ProductWhereInput`](/api-reference/products/inputs/product-where-input.md)

Where filtering options for products.

<a id="category-products-sort-by"></a>

##### [`sortBy`](#category-products-sort-by) ● [`ProductOrder`](/api-reference/products/inputs/product-order.md)

Sort products.

<a id="category-products-search"></a>

##### [`search`](#category-products-search) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

Search products.

<a id="category-products-channel"></a>

##### [`channel`](#category-products-channel) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

Slug of a channel for which the data should be returned.

<a id="category-products-before"></a>

##### [`before`](#category-products-before) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

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

<a id="category-products-after"></a>

##### [`after`](#category-products-after) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

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

<a id="category-products-first"></a>

##### [`first`](#category-products-first) ● [`Int`](/api-reference/miscellaneous/scalars/int.md)

Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

<a id="category-products-last"></a>

##### [`last`](#category-products-last) ● [`Int`](/api-reference/miscellaneous/scalars/int.md)

Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

<a id="children"></a>

#### [`children`](#children) ● [`CategoryCountableConnection`](/api-reference/products/objects/category-countable-connection.md)

List of children of the category.

<a id="category-children-before"></a>

##### [`before`](#category-children-before) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

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

<a id="category-children-after"></a>

##### [`after`](#category-children-after) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

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

<a id="category-children-first"></a>

##### [`first`](#category-children-first) ● [`Int`](/api-reference/miscellaneous/scalars/int.md)

Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

<a id="category-children-last"></a>

##### [`last`](#category-children-last) ● [`Int`](/api-reference/miscellaneous/scalars/int.md)

Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

<a id="background-image"></a>

#### [`backgroundImage`](#background-image) ● [`Image`](/api-reference/miscellaneous/objects/image.md)

Background image of the category.

<a id="category-background-image-size"></a>

##### [`size`](#category-background-image-size) ● [`Int`](/api-reference/miscellaneous/scalars/int.md)

Desired longest side the image in pixels. Defaults to 4096. Images are never cropped. Pass 0 to retrieve the original size (not recommended).

<a id="category-background-image-format"></a>

##### [`format`](#category-background-image-format) ● [`ThumbnailFormatEnum`](/api-reference/miscellaneous/enums/thumbnail-format-enum.md)

The format of the image. When not provided, format of the original image will be used.

<a id="translation"></a>

#### [`translation`](#translation) ● [`CategoryTranslation`](/api-reference/products/objects/category-translation.md)

Returns translated category fields for the given language code.

<a id="category-translation-language-code"></a>

##### [`languageCode`](#category-translation-language-code) ● [`LanguageCodeEnum!`](/api-reference/miscellaneous/enums/language-code-enum.md)

A language code to return the translation for category.

Show deprecatedHide deprecated

<a id="description-json"></a>

#### [`descriptionJson`](#description-json) ● [`JSONString`](/api-reference/miscellaneous/scalars/jsonstring.md)

DEPRECATED

Use the `description` field instead.

Description of the category.

Rich text format. For reference see [https://editorjs.io/](https://editorjs.io/)

<a id="interfaces"></a>

### Interfaces

<a id="node"></a>

#### [`Node`](/api-reference/miscellaneous/interfaces/node.md)

An object with an ID

<a id="objectwithmetadata"></a>

#### [`ObjectWithMetadata`](/api-reference/miscellaneous/interfaces/object-with-metadata.md)

<a id="returned-by"></a>

### Returned By

[`category`](/api-reference/products/queries/category.md) query

<a id="member-of"></a>

### Member Of

[`AssignedMultiCategoryReferenceAttribute`](/api-reference/attributes/objects/assigned-multi-category-reference-attribute.md) object  ● [`AssignedSingleCategoryReferenceAttribute`](/api-reference/attributes/objects/assigned-single-category-reference-attribute.md) object  ● [`Category`](/api-reference/products/objects/category.md) object  ● [`CategoryCountableEdge`](/api-reference/products/objects/category-countable-edge.md) object  ● [`CategoryCreate`](/api-reference/products/objects/category-create.md) object  ● [`CategoryCreated`](/api-reference/products/objects/category-created.md) object  ● [`CategoryDelete`](/api-reference/products/objects/category-delete.md) object  ● [`CategoryDeleted`](/api-reference/products/objects/category-deleted.md) object  ● [`CategoryTranslatableContent`](/api-reference/products/objects/category-translatable-content.md) object  ● [`CategoryTranslate`](/api-reference/products/objects/category-translate.md) object  ● [`CategoryUpdate`](/api-reference/products/objects/category-update.md) object  ● [`CategoryUpdated`](/api-reference/products/objects/category-updated.md) object  ● [`MenuItem`](/api-reference/menu/objects/menu-item.md) object  ● [`Product`](/api-reference/products/objects/product.md) object  ● [`ProductCreated`](/api-reference/products/objects/product-created.md) object  ● [`ProductDeleted`](/api-reference/products/objects/product-deleted.md) object  ● [`ProductMetadataUpdated`](/api-reference/products/objects/product-metadata-updated.md) object  ● [`ProductUpdated`](/api-reference/products/objects/product-updated.md) object

<a id="implemented-by"></a>

### Implemented By

[`_Entity`](/api-reference/miscellaneous/unions/entity.md) union
