ProductTaxonomyAttribute
Describes a product taxonomy attribute.
Type Definition
type ProductTaxonomyAttribute {
id: Int
handle: String
name: String
translatedName: String
type: String
values: [ProductTaxonomyValue]
}Fields
| Field | Type | Nullable | Description | Relationship |
|---|---|---|---|---|
id | Int | Yes | Returns the id. | — |
handle | String | Yes | Returns the handle. | — |
name | String | Yes | Returns the name. | — |
translatedName | String | Yes | Returns the translated name. | — |
type | String | Yes | Returns the type. | — |
values | [ProductTaxonomyValue] | Yes | Returns the values. | Related to ProductTaxonomyValue |
Relationships
- values: An optional list of
ProductTaxonomyValueobjects representing the possible values for this taxonomy attribute. - This type is used by:
Filter.taxonomyAttributeProductOption.taxonomyAttribute
These relationships allow you to traverse from a taxonomy attribute to its possible values and to access taxonomy attributes associated with filters and product options.
Usage Examples
Basic Query
{
productTaxonomyAttribute {
id
handle
name
translatedName
type
}
}Field Selection
{
productTaxonomyAttribute {
name
translatedName
type
}
}Nested Queries
{
productTaxonomyAttribute {
id
name
values {
id
name
}
}
}Filtering and Sorting
Currently, the ProductTaxonomyAttribute type does not expose built-in filtering, sorting, or pagination arguments directly on its fields. Filtering and sorting should be applied at the query level where this type is used, such as within Filter or ProductOption queries.
Implements
This type does not implement any GraphQL interfaces.
Connections
No connection fields are defined on ProductTaxonomyAttribute.
Related Types
- ProductTaxonomyValue: Represents individual values associated with a taxonomy attribute. Accessible via the
valuesfield.
Best Practices
- When querying
values, select only the fields you need to optimize response size. - Use the
handleandnamefields to display taxonomy attributes in user interfaces. - Leverage
translatedNameto support internationalization. - Since fields are optional, always check for null values in your client code to avoid runtime errors.
Notes
- The API currently requires no authentication, but this may change in future versions.
- Fields like
id,handle, andnamemay be null depending on the data availability. - There are no computed or derived fields on this type.
- No field arguments are defined for this type.
- Be mindful that large lists in
valuesmay impact query performance; paginate or limit results at the query level where applicable.
Last updated on