Skip to main content

productAttributeUsage

Requires permission products:product:read.

How many products and variants carry an attribute (or one value of it), and which product finders name 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:

query ProductAttributeUsage($attributeKey: String!) {
productAttributeUsage(attributeKey: $attributeKey) {
finders
productCount
variantCount
}
}

Variables:

{
"attributeKey": "string"
}

Response:

{
"data": {
"productAttributeUsage": {
"finders": [
"string"
],
"productCount": 0,
"variantCount": 0
}
}
}
productAttributeUsage(
attributeKey: String!
value: String
): ProductAttributeUsage!

Arguments​

productAttributeUsage.attributeKey ● String! non-null scalar​

The attribute, in any spelling.

productAttributeUsage.value ● String scalar​

One value of it; absent asks about the whole attribute.

Type​

ProductAttributeUsage object​

Where an attribute, or one value of it, is used.