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
where: AttributeValueWhereInput
search: String
before: String
after: String
first: Int
last: Int
): AttributeValueCountableConnection
valueRequired: Boolean!
visibleInStorefront: Boolean!
filterableInStorefront: Boolean! @deprecated
filterableInDashboard: Boolean!
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
}
Fields
Attribute.id ● ID! non-null scalar miscellaneous
The ID of the attribute.
Attribute.privateMetadata ● [MetadataItem!]! non-null object miscellaneous
List of private metadata items. Requires staff permissions to access.
Attribute.privateMetafield ● String scalar miscellaneous
A single key from private metadata. Requires staff permissions to access.
Tip: Use GraphQL aliases to fetch multiple keys.
Attribute.privateMetafield.key ● String! non-null scalar miscellaneous
Attribute.privateMetafields ● Metadata scalar miscellaneous
Private metadata. Requires staff permissions to access. Use keys to control which fields you want to include. The default is to include everything.
Attribute.privateMetafields.keys ● [String!] list scalar miscellaneous
Attribute.metadata ● [MetadataItem!]! non-null object miscellaneous
List of public metadata items. Can be accessed without permissions.
Attribute.metafield ● String scalar miscellaneous
A single key from public metadata.
Tip: Use GraphQL aliases to fetch multiple keys.
Attribute.metafield.key ● String! non-null scalar miscellaneous
Attribute.metafields ● Metadata scalar miscellaneous
Public metadata. Use keys to control which fields you want to include. The default is to include everything.
Attribute.metafields.keys ● [String!] list scalar miscellaneous
Attribute.inputType ● AttributeInputTypeEnum enum attributes
The input type to use for entering attribute values in the dashboard.
Attribute.entityType ● AttributeEntityTypeEnum enum attributes
The entity type which can be used as a reference.
Attribute.referenceTypes ● [ReferenceType!] list union miscellaneous
The reference types (product or page type) that are used to narrow down the choices of reference objects.
Added in Saleor 3.22Attribute.referenceTypes.limit ● PositiveInt scalar miscellaneous
Maximum number of objects to return. Value must be greater than 0. Default is 100.
Attribute.name ● String scalar miscellaneous
Name of an attribute displayed in the interface.
Attribute.slug ● String scalar miscellaneous
Internal representation of an attribute name.
Attribute.type ● AttributeTypeEnum enum attributes
The attribute type.
Attribute.unit ● MeasurementUnitsEnum enum miscellaneous
The unit of attribute values.
Attribute.choices ● AttributeValueCountableConnection object attributes
A list of predefined attribute choices available for selection. Available only for attributes with predefined choices.
Attribute.choices.sortBy ● AttributeChoicesSortingInput input attributes
Sort attribute choices.
Attribute.choices.filter ● AttributeValueFilterInput deprecated input attributes
Use where filter instead.
Filtering options for attribute choices.
Attribute.choices.where ● AttributeValueWhereInput input attributes
Where filtering options for attribute choices.
Added in Saleor 3.22Attribute.choices.search ● String scalar miscellaneous
Search attribute choices.
Added in Saleor 3.22Attribute.choices.before ● String scalar miscellaneous
Return the elements in the list that come before the specified cursor.
Attribute.choices.after ● String scalar miscellaneous
Return the elements in the list that come after the specified cursor.
Attribute.choices.first ● Int scalar miscellaneous
Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.
Attribute.choices.last ● Int scalar miscellaneous
Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.
Attribute.valueRequired ● Boolean! non-null scalar miscellaneous
Whether the attribute requires values to be passed or not.
Attribute.visibleInStorefront ● Boolean! non-null scalar miscellaneous
Whether the attribute should be visible or not in storefront.
Attribute.filterableInStorefront ● Boolean! deprecated non-null scalar miscellaneous
No longer supported
Whether the attribute can be filtered in storefront.
Attribute.filterableInDashboard ● Boolean! non-null scalar miscellaneous
Whether the attribute can be filtered in dashboard.
Attribute.availableInGrid ● Boolean! deprecated non-null scalar miscellaneous
No longer supported
Whether the attribute can be displayed in the admin product list.
Attribute.storefrontSearchPosition ● Int! deprecated non-null scalar miscellaneous
No longer supported
The position of the attribute in the storefront navigation (0 by default).
Attribute.translation ● AttributeTranslation object attributes
Returns translated attribute fields for the given language code.
Attribute.translation.languageCode ● LanguageCodeEnum! non-null enum miscellaneous
A language code to return the translation for attribute.
Attribute.withChoices ● Boolean! non-null scalar miscellaneous
Flag indicating that attribute has predefined choices.
Attribute.productTypes ● ProductTypeCountableConnection! non-null object products
A list of product types that use this attribute as a product attribute.
Attribute.productTypes.before ● String scalar miscellaneous
Return the elements in the list that come before the specified cursor.
Attribute.productTypes.after ● String scalar miscellaneous
Return the elements in the list that come after the specified cursor.
Attribute.productTypes.first ● Int scalar miscellaneous
Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.
Attribute.productTypes.last ● Int scalar miscellaneous
Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.
Attribute.productVariantTypes ● ProductTypeCountableConnection! non-null object products
A list of product types that use this attribute as a product variant attribute.
Attribute.productVariantTypes.before ● String scalar miscellaneous
Return the elements in the list that come before the specified cursor.
Attribute.productVariantTypes.after ● String scalar miscellaneous
Return the elements in the list that come after the specified cursor.
Attribute.productVariantTypes.first ● Int scalar miscellaneous
Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.
Attribute.productVariantTypes.last ● Int scalar miscellaneous
Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.
Attribute.externalReference ● String scalar miscellaneous
External ID of this attribute.
Interfaces
Node interface miscellaneous
An object with an ID
ObjectWithMetadata interface miscellaneous
Returned By
attribute query
Member Of
AssignedAttribute interface ● AssignedBooleanAttribute object ● AssignedDateAttribute object ● AssignedDateTimeAttribute object ● AssignedFileAttribute object ● AssignedMultiCategoryReferenceAttribute object ● AssignedMultiChoiceAttribute object ● AssignedMultiCollectionReferenceAttribute object ● AssignedMultiPageReferenceAttribute object ● AssignedMultiProductReferenceAttribute object ● AssignedMultiProductVariantReferenceAttribute object ● AssignedNumericAttribute object ● AssignedPlainTextAttribute object ● AssignedSingleCategoryReferenceAttribute object ● AssignedSingleChoiceAttribute object ● AssignedSingleCollectionReferenceAttribute object ● AssignedSinglePageReferenceAttribute object ● AssignedSingleProductReferenceAttribute object ● AssignedSingleProductVariantReferenceAttribute object ● AssignedSwatchAttribute object ● AssignedTextAttribute object ● AssignedVariantAttribute object ● AttributeBulkCreateResult object ● AttributeBulkUpdateResult object ● AttributeCountableEdge object ● AttributeCreate object ● AttributeCreated object ● AttributeDelete object ● AttributeDeleted object ● AttributeReorderValues object ● AttributeTranslatableContent object ● AttributeTranslate object ● AttributeUpdate object ● AttributeUpdated object ● AttributeValueCreate object ● AttributeValueDelete object ● AttributeValueUpdate object ● PageType object ● ProductType object ● SelectedAttribute object