productAttributes
Requires permission products:product:read.
Lists the product attributes the organization's active variants carry, each value with how many variants carry it and the picture set for it. Requires permission to read products.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
query ProductAttributes {
productAttributes {
key
productCount
valuesTruncated
variantCount
values {
imageUrl
value
variantCount
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query ProductAttributes {\n productAttributes {\n key\n productCount\n valuesTruncated\n variantCount\n values {\n imageUrl\n value\n variantCount\n }\n }\n}"
}
EOF
Response:
{
"data": {
"productAttributes": [
{
"key": "string",
"productCount": 0,
"valuesTruncated": true,
"variantCount": 0,
"values": [
{
"imageUrl": "string",
"value": "string",
"variantCount": 0
}
]
}
]
}
}
productAttributes: [ProductAttribute!]!
Type
ProductAttribute object
A product attribute and its values.