Skip to content
Saleor
Esc
↑↓navigate↵open⌘Jpreview

Schema: Saleor 3.23.43Download SDLUpgrade guides

On this page

Attribute Object

Custom attribute of a product. Attributes can be assigned to products and variants at the product type level.

type Attribute 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
  inputType: AttributeInputTypeEnum
  entityType: AttributeEntityTypeEnum
  referenceTypes(limit: PositiveInt = 100): [ReferenceType!]
  name: String!
  slug: String!
  type: AttributeTypeEnum!
  unit: MeasurementUnitsEnum
  choices(sortBy: AttributeChoicesSortingInput, filter: AttributeValueFilterInput @deprecated(reason: "Use `where` filter instead."), where: AttributeValueWhereInput, search: String, before: String, after: String, first: Int, last: Int): AttributeValueCountableConnection
  valueRequired: Boolean!
  visibleInStorefront: Boolean!
  filterableInStorefront: Boolean! @deprecated(reason: "This flag is not used by Saleor. Keep the logic in the storefront or use `Attribute` metadata instead.")
  filterableInDashboard: Boolean! @deprecated(reason: "This flag is not used by Saleor. Keep the logic in the dashboard or use `Attribute` metadata instead.")
  availableInGrid: Boolean! @deprecated(reason: "This flag is not used by Saleor. Keep the logic in the storefront or use `Attribute` metadata instead.")
  storefrontSearchPosition: Int! @deprecated(reason: "This flag is not used by Saleor. Keep the logic in the storefront or use `Attribute` metadata instead.")
  translation(languageCode: LanguageCodeEnum!): AttributeTranslation
  withChoices: Boolean!
  productTypes(before: String, after: String, first: Int, last: Int): ProductTypeCountableConnection!
  productVariantTypes(before: String, after: String, first: Int, last: Int): ProductTypeCountableConnection!
  externalReference: String
}

Interfaces

Node, ObjectWithMetadata

Fields

id

id · ID!

The ID of the attribute.

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!]

inputType

inputType · AttributeInputTypeEnum

The input type to use for entering attribute values in the dashboard.

entityType

entityType · AttributeEntityTypeEnum

The entity type which can be used as a reference.

referenceTypes

referenceTypes · [ReferenceType!]

The reference types (product or page type) that are used to narrow down the choices of reference objects.

Added in Saleor 3.22

limit

limit · PositiveInt

Maximum number of objects to return. Value must be greater than 0. Default is 100.

Default: 100.

name

name · String!

Name of an attribute displayed in the interface.

slug

slug · String!

Internal representation of an attribute name.

type

type · AttributeTypeEnum!

The attribute type.

unit

unit · MeasurementUnitsEnum

The unit of attribute values.

choices

choices · AttributeValueCountableConnection

A list of predefined attribute choices available for selection. Available only for attributes with predefined choices.

sortBy

sortBy · AttributeChoicesSortingInput

Sort attribute choices.

filter

filter · AttributeValueFilterInput

Filtering options for attribute choices.

where

where · AttributeValueWhereInput

Where filtering options for attribute choices.

Added in Saleor 3.22

search · String

Search attribute choices.

Added in Saleor 3.22

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.

valueRequired

valueRequired · Boolean!

Whether the attribute requires values to be passed or not.

Requires one of the following permissions:MANAGE_PAGESMANAGE_PAGE_TYPES_AND_ATTRIBUTESMANAGE_PRODUCTSMANAGE_PRODUCT_TYPES_AND_ATTRIBUTES

visibleInStorefront

visibleInStorefront · Boolean!

Whether the attribute should be visible or not in storefront.

Requires one of the following permissions:MANAGE_PAGESMANAGE_PAGE_TYPES_AND_ATTRIBUTESMANAGE_PRODUCTSMANAGE_PRODUCT_TYPES_AND_ATTRIBUTES

filterableInStorefront

filterableInStorefront · Boolean!

Whether the attribute can be filtered in storefront.

Requires one of the following permissions:MANAGE_PAGESMANAGE_PAGE_TYPES_AND_ATTRIBUTESMANAGE_PRODUCTSMANAGE_PRODUCT_TYPES_AND_ATTRIBUTES

filterableInDashboard

filterableInDashboard · Boolean!

Whether the attribute can be filtered in dashboard.

Requires one of the following permissions:MANAGE_PAGESMANAGE_PAGE_TYPES_AND_ATTRIBUTESMANAGE_PRODUCTSMANAGE_PRODUCT_TYPES_AND_ATTRIBUTES

availableInGrid

availableInGrid · Boolean!

Whether the attribute can be displayed in the admin product list.

Requires one of the following permissions:MANAGE_PAGESMANAGE_PAGE_TYPES_AND_ATTRIBUTESMANAGE_PRODUCTSMANAGE_PRODUCT_TYPES_AND_ATTRIBUTES

storefrontSearchPosition

storefrontSearchPosition · Int!

The position of the attribute in the storefront navigation (0 by default).

Requires one of the following permissions:MANAGE_PAGESMANAGE_PAGE_TYPES_AND_ATTRIBUTESMANAGE_PRODUCTSMANAGE_PRODUCT_TYPES_AND_ATTRIBUTES

translation

translation · AttributeTranslation

Returns translated attribute fields for the given language code.

languageCode

languageCode · LanguageCodeEnum!

A language code to return the translation for attribute.

withChoices

withChoices · Boolean!

Flag indicating that attribute has predefined choices.

productTypes

productTypes · ProductTypeCountableConnection!

A list of product types that use this attribute as a product attribute.

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.

productVariantTypes

productVariantTypes · ProductTypeCountableConnection!

A list of product types that use this attribute as a product variant attribute.

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.

externalReference

externalReference · String

External ID of this attribute.

Used by


Schema: Saleor 3.23.43. Download SDL.

Last updated on August 24, 2026

Was this page helpful?