Access product attributes used for variant classification.
Attribute — Returns a single attribute by id
Attribute — Returns a single attribute by idExample Query:
query GetAttribute($id: ID!) {
Attribute(id: $id) {
id
label
option {
id
label
}
}
}Example Result:
{
"data": {
"Attribute": {
"id": 5001,
"label": "Red",
"option": {
"id": 10001,
"label": "Color"
}
}
}
}Attributes — Returns a list of attributes with sorting and filters
Attributes — Returns a list of attributes with sorting and filtersExample Query:
query Attributes(
$where: QueryAttributesWhereWhereConditions,
$orderBy: [QueryAttributesOrderByOrderByClause!]
) {
Attributes(
where: $where,
orderBy: $orderBy
) {
id
label
option { id label }
}
}Example Variables:
{
"where": {
"AND": [
{ "column": "OPTION_ID", "operator": "EQ", "value": 10001 }
]
},
"orderBy": [
{ "column": "LABEL", "order": "ASC" }
]
}Available fields
Data Types
ProductAttribute
ProductAttributeAttributeVariant
AttributeVariant| Field | Type | Description |
|---|---|---|
id | ID | Unique identifier. |
attribute_id | ID | ID of the attribute. |
option_id | Int | ID of the option (e.g. Color, Size). |
variant_id | ID | ID of the variant. |
value | String | Selected value for this attribute (e.g. "Red", "XL"). |
attribute | Attribute | The attribute details. |
option | Option | The option this attribute belongs to. |
AttributeVariantInput
AttributeVariantInput| Field | Type | Description |
|---|---|---|
id | ID | Attribute variant ID (for updates). |
attribute | AttributeInput | Attribute details. |
Filters
| Field | Example |
|---|---|
id | { "column": "ID", "operator": "EQ", "value": 5001 } |
label | { "column": "LABEL", "operator": "LIKE", "value": "%Red%" } |
option_id | { "column": "OPTION_ID", "operator": "EQ", "value": 10001 } |
