Skip to main content

attribute Query

Look up an attribute by ID, slug or external reference.

attribute(
id: ID
slug: String
externalReference: String
): Attribute
Details
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
}

Arguments

id ● ID

ID of the attribute.

slug ● String

Slug of the attribute.

externalReference ● String

External ID of the attribute.

Type

Attribute

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