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
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.22limit
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.22search
search · String
Search attribute choices.
Added in Saleor 3.22before
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.
visibleInStorefront
visibleInStorefront · Boolean!
Whether the attribute should be visible or not in storefront.
filterableInStorefront
filterableInStorefront · Boolean!
Whether the attribute can be filtered in storefront.
filterableInDashboard
filterableInDashboard · Boolean!
Whether the attribute can be filtered in dashboard.
availableInGrid
availableInGrid · Boolean!
Whether the attribute can be displayed in the admin product list.
storefrontSearchPosition
storefrontSearchPosition · Int!
The position of the attribute in the storefront navigation (0 by default).
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
- AssignedAttribute (interfaces)
- AssignedBooleanAttribute (objects)
- AssignedDateAttribute (objects)
- AssignedDateTimeAttribute (objects)
- AssignedFileAttribute (objects)
- AssignedMultiCategoryReferenceAttribute (objects)
- AssignedMultiChoiceAttribute (objects)
- AssignedMultiCollectionReferenceAttribute (objects)
- AssignedMultiPageReferenceAttribute (objects)
- AssignedMultiProductReferenceAttribute (objects)
- AssignedMultiProductVariantReferenceAttribute (objects)
- AssignedNumericAttribute (objects)
- AssignedPlainTextAttribute (objects)
- AssignedSingleCategoryReferenceAttribute (objects)
- AssignedSingleChoiceAttribute (objects)
- AssignedSingleCollectionReferenceAttribute (objects)
- AssignedSinglePageReferenceAttribute (objects)
- AssignedSingleProductReferenceAttribute (objects)
- AssignedSingleProductVariantReferenceAttribute (objects)
- AssignedSwatchAttribute (objects)
- AssignedTextAttribute (objects)
- AssignedVariantAttribute (objects)
- AttributeBulkCreateResult (objects)
- AttributeBulkUpdateResult (objects)
- AttributeCountableEdge (objects)
- AttributeCreate (objects)
- AttributeCreated (objects)
- AttributeDelete (objects)
- AttributeDeleted (objects)
- AttributeReorderValues (objects)
- AttributeTranslatableContent (objects)
- AttributeTranslate (objects)
- AttributeUpdate (objects)
- AttributeUpdated (objects)
- AttributeValueCreate (objects)
- AttributeValueDelete (objects)
- AttributeValueUpdate (objects)
- SelectedAttribute (objects)
- attribute (queries)
- PageType (objects)
- ProductType (objects)
- CustomerType (objects)
Schema: Saleor 3.23.43. Download SDL.