Retrieve product options (e.g., Color, Size) and their possible values.
Option — Returns a single option by id
Option — Returns a single option by idExample Query:
query GetOption($id: ID!) {
Option(id: $id) {
id
label
weight
attributes {
paginatorInfo { total }
data { id label }
}
}
}Example Result:
{
"data": {
"Option": {
"id": 10001,
"label": "Color",
"weight": 0,
"attributes": {
"paginatorInfo": { "total": 3 },
"data": [
{ "id": 5001, "label": "Red" },
{ "id": 5002, "label": "Blue" },
{ "id": 5003, "label": "Green" }
]
}
}
}
}Options — Returns a list of options with sorting and filters
Options — Returns a list of options with sorting and filtersExample Query:
query Options(
$where: QueryOptionsWhereWhereConditions,
$orderBy: [QueryOptionsOrderByOrderByClause!]
) {
Options(
where: $where,
orderBy: $orderBy
) {
id
label
weight
}
}Example Variables:
{
"where": {
"AND": [
{ "column": "LABEL", "operator": "LIKE", "value": "%Col%" }
]
},
"orderBy": [
{ "column": "ID", "order": "ASC" }
]
}Available fields
| Field | Type | Description |
|---|---|---|
id | Int | Unique identifier. |
label | String | Name of the option (e.g. "Color"). |
weight | Int | Display order weight. |
attributes | [Attribute] | Values associated with this option. |
Data Types
OptionCreateInput
OptionCreateInputFilters
| Field | Example |
|---|---|
id | { "column": "ID", "operator": "EQ", "value": 10001 } |
label | { "column": "LABEL", "operator": "LIKE", "value": "%Size%" } |
