Attribute
ObjectDefines a product attribute in Thor, such as color, size, or material, that describes a specific aspect of a product. Attributes are used to distinguish between different variants of the same product—each unique combination of attribute values represents a distinct variant. This enables flexible filtering, grouping, and enrichment of product data across the catalog.
Fields
- ID!
id The unique identifier of the attribute.
- [MetadataItem!]!
metadata Gets the metadata associated with the attribute.
- [Metafield!]!
metafields A list of metafields associated with the attribute. If a metafield definition has no explicit assignment for this attribute, the definition’s default value is returned.
- String!
name The name of the attribute.
- ProductConnection!
references Products to which this attribute is assigned. These assignments prevent the attribute from being deleted, even when none of its values are selected by a product variant.
- Long!
referencesCount The number of products to which this attribute is assigned.
- [Translation!]!
translations Translations registered for this product attribute.
- ProductAttributeType!
type The type of the attribute.
Possible enum valuesSWATCHPresents the attribute value as a visual swatch, such as a color or pattern.
TEXTPresents the attribute value as text.
- AttributeValueConnection!
values A list of values associated with the attribute.
- Long!
valuesCount The number of values that are associated with the attribute.
Queries
Gets a product attribute by its ID.
Retrieves a paginated list of product attributes.
Mutations
Creates a new product attribute.
Deletes a product attribute by its identifier.
Updates an existing product attribute.
Adds multiple values to an existing product attribute.
Deletes multiple values from an existing product attribute.
Updates multiple values of an existing product attribute.