setProductAttributeValueParent
Requires permission products:product:update.
Sets or clears the value another attribute's value belongs to (a Phone Model belongs to a Compatible Brand); the buyer filters then list only the values whose parent is picked. 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:
- GraphQL
- cURL
mutation SetProductAttributeValueParent($input: SetProductAttributeValueParentInput!) {
setProductAttributeValueParent(input: $input) {
imageUrl
parentAttributeKey
parentValue
value
variantCount
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation SetProductAttributeValueParent($input: SetProductAttributeValueParentInput!) {\n setProductAttributeValueParent(input: $input) {\n imageUrl\n parentAttributeKey\n parentValue\n value\n variantCount\n }\n}",
"variables": {
"input": {
"attributeKey": "string",
"value": "string"
}
}
}
EOF
Variables:
{
"input": {
"attributeKey": "string",
"value": "string"
}
}
Response:
{
"data": {
"setProductAttributeValueParent": {
"imageUrl": "string",
"parentAttributeKey": "string",
"parentValue": "string",
"value": "string",
"variantCount": 0
}
}
}
setProductAttributeValueParent(
input: SetProductAttributeValueParentInput!
): ProductAttributeValue!
Arguments
setProductAttributeValueParent.input ● SetProductAttributeValueParentInput! non-null input
The value and the value it belongs to.
Type
ProductAttributeValue object
One value of a product attribute.