renameProductAttribute
Requires permission products:product:update.
Renames a product attribute on every product carrying it and in the product finders that name it. 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 RenameProductAttribute($input: RenameProductAttributeInput!) {
renameProductAttribute(input: $input) {
findersNeedingAttention
findersUpdated
variantsUpdated
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation RenameProductAttribute($input: RenameProductAttributeInput!) {\n renameProductAttribute(input: $input) {\n findersNeedingAttention\n findersUpdated\n variantsUpdated\n }\n}",
"variables": {
"input": {
"attributeKey": "string",
"name": "string"
}
}
}
EOF
Variables:
{
"input": {
"attributeKey": "string",
"name": "string"
}
}
Response:
{
"data": {
"renameProductAttribute": {
"findersNeedingAttention": [
"string"
],
"findersUpdated": [
"string"
],
"variantsUpdated": 0
}
}
}
renameProductAttribute(
input: RenameProductAttributeInput!
): ProductAttributeChangeResult!
Arguments
renameProductAttribute.input ● RenameProductAttributeInput! non-null input
The attribute and its new name.
Type
ProductAttributeChangeResult object
What an attribute change did.