Skip to main content

setProductAttributeValueImage

Requires permission products:product:update.

Sets or clears the picture of one product attribute value; product finders then show it for that value. Requires permission to update 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:

mutation SetProductAttributeValueImage($input: SetProductAttributeValueImageInput!) {
setProductAttributeValueImage(input: $input) {
imageUrl
value
variantCount
}
}

Variables:

{
"input": {
"attributeKey": "string",
"value": "string"
}
}

Response:

{
"data": {
"setProductAttributeValueImage": {
"imageUrl": "string",
"value": "string",
"variantCount": 0
}
}
}
setProductAttributeValueImage(
input: SetProductAttributeValueImageInput!
): ProductAttributeValue!

Arguments​

setProductAttributeValueImage.input ● SetProductAttributeValueImageInput! non-null input​

The value and its new picture.

Type​

ProductAttributeValue object​

One value of a product attribute.