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

# Attribute Object

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

```graphql
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
    where: AttributeValueWhereInput
    search: String
    before: String
    after: String
    first: Int
    last: Int
  ): AttributeValueCountableConnection
  valueRequired: Boolean!
  visibleInStorefront: Boolean!
  filterableInStorefront: Boolean! @deprecated
  filterableInDashboard: Boolean! @deprecated
  availableInGrid: Boolean! @deprecated
  storefrontSearchPosition: Int! @deprecated
  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
}
```

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

### Fields

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

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

The ID of the attribute.

<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="attribute-private-metafield-key"></a>

##### [`key`](#attribute-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="attribute-private-metafields-keys"></a>

##### [`keys`](#attribute-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="attribute-metafield-key"></a>

##### [`key`](#attribute-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="attribute-metafields-keys"></a>

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

<a id="input-type"></a>

#### [`inputType`](#input-type) ● [`AttributeInputTypeEnum`](/api-reference/attributes/enums/attribute-input-type-enum.md)

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

<a id="entity-type"></a>

#### [`entityType`](#entity-type) ● [`AttributeEntityTypeEnum`](/api-reference/attributes/enums/attribute-entity-type-enum.md)

The entity type which can be used as a reference.

<a id="reference-types"></a>

#### [`referenceTypes`](#reference-types) ● [`[ReferenceType!]`](/api-reference/miscellaneous/unions/reference-type.md)

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

Added in Saleor 3.22

<a id="attribute-reference-types-limit"></a>

##### [`limit`](#attribute-reference-types-limit) ● [`PositiveInt`](/api-reference/miscellaneous/scalars/positive-int.md)

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

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

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

Name of an attribute displayed in the interface.

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

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

Internal representation of an attribute name.

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

#### [`type`](#type) ● [`AttributeTypeEnum!`](/api-reference/attributes/enums/attribute-type-enum.md)

The attribute type.

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

#### [`unit`](#unit) ● [`MeasurementUnitsEnum`](/api-reference/miscellaneous/enums/measurement-units-enum.md)

The unit of attribute values.

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

#### [`choices`](#choices) ● [`AttributeValueCountableConnection`](/api-reference/attributes/objects/attribute-value-countable-connection.md)

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

<a id="attribute-choices-sort-by"></a>

##### [`sortBy`](#attribute-choices-sort-by) ● [`AttributeChoicesSortingInput`](/api-reference/attributes/inputs/attribute-choices-sorting-input.md)

Sort attribute choices.

<a id="attribute-choices-filter"></a>

##### [`filter`](#attribute-choices-filter) ● [`AttributeValueFilterInput`](/api-reference/attributes/inputs/attribute-value-filter-input.md)

DEPRECATED

Use `where` filter instead.

Filtering options for attribute choices.

<a id="attribute-choices-where"></a>

##### [`where`](#attribute-choices-where) ● [`AttributeValueWhereInput`](/api-reference/attributes/inputs/attribute-value-where-input.md)

Where filtering options for attribute choices.

Added in Saleor 3.22

<a id="attribute-choices-search"></a>

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

Search attribute choices.

Added in Saleor 3.22

<a id="attribute-choices-before"></a>

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

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

<a id="attribute-choices-after"></a>

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

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

<a id="attribute-choices-first"></a>

##### [`first`](#attribute-choices-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="attribute-choices-last"></a>

##### [`last`](#attribute-choices-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="value-required"></a>

#### [`valueRequired`](#value-required) ● [`Boolean!`](/api-reference/miscellaneous/scalars/boolean.md)

Whether the attribute requires values to be passed or not.

Requires one of the following permissions: MANAGE\_PAGES MANAGE\_PAGE\_TYPES\_AND\_ATTRIBUTES MANAGE\_PRODUCTS MANAGE\_PRODUCT\_TYPES\_AND\_ATTRIBUTES

<a id="visible-in-storefront"></a>

#### [`visibleInStorefront`](#visible-in-storefront) ● [`Boolean!`](/api-reference/miscellaneous/scalars/boolean.md)

Whether the attribute should be visible or not in storefront.

Requires one of the following permissions: MANAGE\_PAGES MANAGE\_PAGE\_TYPES\_AND\_ATTRIBUTES MANAGE\_PRODUCTS MANAGE\_PRODUCT\_TYPES\_AND\_ATTRIBUTES

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

#### [`translation`](#translation) ● [`AttributeTranslation`](/api-reference/attributes/objects/attribute-translation.md)

Returns translated attribute fields for the given language code.

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

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

A language code to return the translation for attribute.

<a id="with-choices"></a>

#### [`withChoices`](#with-choices) ● [`Boolean!`](/api-reference/miscellaneous/scalars/boolean.md)

Flag indicating that attribute has predefined choices.

<a id="product-types"></a>

#### [`productTypes`](#product-types) ● [`ProductTypeCountableConnection!`](/api-reference/products/objects/product-type-countable-connection.md)

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

<a id="attribute-product-types-before"></a>

##### [`before`](#attribute-product-types-before) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

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

<a id="attribute-product-types-after"></a>

##### [`after`](#attribute-product-types-after) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

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

<a id="attribute-product-types-first"></a>

##### [`first`](#attribute-product-types-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="attribute-product-types-last"></a>

##### [`last`](#attribute-product-types-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="product-variant-types"></a>

#### [`productVariantTypes`](#product-variant-types) ● [`ProductTypeCountableConnection!`](/api-reference/products/objects/product-type-countable-connection.md)

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

<a id="attribute-product-variant-types-before"></a>

##### [`before`](#attribute-product-variant-types-before) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

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

<a id="attribute-product-variant-types-after"></a>

##### [`after`](#attribute-product-variant-types-after) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

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

<a id="attribute-product-variant-types-first"></a>

##### [`first`](#attribute-product-variant-types-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="attribute-product-variant-types-last"></a>

##### [`last`](#attribute-product-variant-types-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="external-reference"></a>

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

External ID of this attribute.

Show deprecatedHide deprecated

<a id="filterable-in-storefront"></a>

#### [`filterableInStorefront`](#filterable-in-storefront) ● [`Boolean!`](/api-reference/miscellaneous/scalars/boolean.md)

DEPRECATED

This flag is not used by Saleor. Keep the logic in the storefront or use `Attribute` metadata instead.

Whether the attribute can be filtered in storefront.

Requires one of the following permissions: MANAGE\_PAGES MANAGE\_PAGE\_TYPES\_AND\_ATTRIBUTES MANAGE\_PRODUCTS MANAGE\_PRODUCT\_TYPES\_AND\_ATTRIBUTES

<a id="filterable-in-dashboard"></a>

#### [`filterableInDashboard`](#filterable-in-dashboard) ● [`Boolean!`](/api-reference/miscellaneous/scalars/boolean.md)

DEPRECATED

This flag is not used by Saleor. Keep the logic in the dashboard or use `Attribute` metadata instead.

Whether the attribute can be filtered in dashboard.

Requires one of the following permissions: MANAGE\_PAGES MANAGE\_PAGE\_TYPES\_AND\_ATTRIBUTES MANAGE\_PRODUCTS MANAGE\_PRODUCT\_TYPES\_AND\_ATTRIBUTES

<a id="available-in-grid"></a>

#### [`availableInGrid`](#available-in-grid) ● [`Boolean!`](/api-reference/miscellaneous/scalars/boolean.md)

DEPRECATED

This flag is not used by Saleor. Keep the logic in the storefront or use `Attribute` metadata instead.

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

Requires one of the following permissions: MANAGE\_PAGES MANAGE\_PAGE\_TYPES\_AND\_ATTRIBUTES MANAGE\_PRODUCTS MANAGE\_PRODUCT\_TYPES\_AND\_ATTRIBUTES

<a id="storefront-search-position"></a>

#### [`storefrontSearchPosition`](#storefront-search-position) ● [`Int!`](/api-reference/miscellaneous/scalars/int.md)

DEPRECATED

This flag is not used by Saleor. Keep the logic in the storefront or use `Attribute` metadata instead.

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

Requires one of the following permissions: MANAGE\_PAGES MANAGE\_PAGE\_TYPES\_AND\_ATTRIBUTES MANAGE\_PRODUCTS MANAGE\_PRODUCT\_TYPES\_AND\_ATTRIBUTES

<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

[`attribute`](/api-reference/attributes/queries/attribute.md) query

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

### Member Of

[`AssignedAttribute`](/api-reference/attributes/interfaces/assigned-attribute.md) interface  ● [`AssignedBooleanAttribute`](/api-reference/attributes/objects/assigned-boolean-attribute.md) object  ● [`AssignedDateAttribute`](/api-reference/attributes/objects/assigned-date-attribute.md) object  ● [`AssignedDateTimeAttribute`](/api-reference/attributes/objects/assigned-date-time-attribute.md) object  ● [`AssignedFileAttribute`](/api-reference/attributes/objects/assigned-file-attribute.md) object  ● [`AssignedMultiCategoryReferenceAttribute`](/api-reference/attributes/objects/assigned-multi-category-reference-attribute.md) object  ● [`AssignedMultiChoiceAttribute`](/api-reference/attributes/objects/assigned-multi-choice-attribute.md) object  ● [`AssignedMultiCollectionReferenceAttribute`](/api-reference/attributes/objects/assigned-multi-collection-reference-attribute.md) object  ● [`AssignedMultiPageReferenceAttribute`](/api-reference/attributes/objects/assigned-multi-page-reference-attribute.md) object  ● [`AssignedMultiProductReferenceAttribute`](/api-reference/attributes/objects/assigned-multi-product-reference-attribute.md) object  ● [`AssignedMultiProductVariantReferenceAttribute`](/api-reference/attributes/objects/assigned-multi-product-variant-reference-attribute.md) object  ● [`AssignedNumericAttribute`](/api-reference/attributes/objects/assigned-numeric-attribute.md) object  ● [`AssignedPlainTextAttribute`](/api-reference/attributes/objects/assigned-plain-text-attribute.md) object  ● [`AssignedSingleCategoryReferenceAttribute`](/api-reference/attributes/objects/assigned-single-category-reference-attribute.md) object  ● [`AssignedSingleChoiceAttribute`](/api-reference/attributes/objects/assigned-single-choice-attribute.md) object  ● [`AssignedSingleCollectionReferenceAttribute`](/api-reference/attributes/objects/assigned-single-collection-reference-attribute.md) object  ● [`AssignedSinglePageReferenceAttribute`](/api-reference/attributes/objects/assigned-single-page-reference-attribute.md) object  ● [`AssignedSingleProductReferenceAttribute`](/api-reference/attributes/objects/assigned-single-product-reference-attribute.md) object  ● [`AssignedSingleProductVariantReferenceAttribute`](/api-reference/attributes/objects/assigned-single-product-variant-reference-attribute.md) object  ● [`AssignedSwatchAttribute`](/api-reference/attributes/objects/assigned-swatch-attribute.md) object  ● [`AssignedTextAttribute`](/api-reference/attributes/objects/assigned-text-attribute.md) object  ● [`AssignedVariantAttribute`](/api-reference/attributes/objects/assigned-variant-attribute.md) object  ● [`AttributeBulkCreateResult`](/api-reference/attributes/objects/attribute-bulk-create-result.md) object  ● [`AttributeBulkUpdateResult`](/api-reference/attributes/objects/attribute-bulk-update-result.md) object  ● [`AttributeCountableEdge`](/api-reference/attributes/objects/attribute-countable-edge.md) object  ● [`AttributeCreate`](/api-reference/attributes/objects/attribute-create.md) object  ● [`AttributeCreated`](/api-reference/attributes/objects/attribute-created.md) object  ● [`AttributeDelete`](/api-reference/attributes/objects/attribute-delete.md) object  ● [`AttributeDeleted`](/api-reference/attributes/objects/attribute-deleted.md) object  ● [`AttributeReorderValues`](/api-reference/attributes/objects/attribute-reorder-values.md) object  ● [`AttributeTranslatableContent`](/api-reference/attributes/objects/attribute-translatable-content.md) object  ● [`AttributeTranslate`](/api-reference/attributes/objects/attribute-translate.md) object  ● [`AttributeUpdate`](/api-reference/attributes/objects/attribute-update.md) object  ● [`AttributeUpdated`](/api-reference/attributes/objects/attribute-updated.md) object  ● [`AttributeValueCreate`](/api-reference/attributes/objects/attribute-value-create.md) object  ● [`AttributeValueDelete`](/api-reference/attributes/objects/attribute-value-delete.md) object  ● [`AttributeValueUpdate`](/api-reference/attributes/objects/attribute-value-update.md) object  ● [`CustomerType`](/api-reference/users/objects/customer-type.md) object  ● [`PageType`](/api-reference/pages/objects/page-type.md) object  ● [`ProductType`](/api-reference/products/objects/product-type.md) object  ● [`SelectedAttribute`](/api-reference/attributes/objects/selected-attribute.md) object
