Skip to main content

createProductAttribute

Requires permission products:product:update.

Adds a product attribute, with any first values, before any product carries 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:

mutation CreateProductAttribute($input: CreateProductAttributeInput!) {
createProductAttribute(input: $input) {
findersNeedingAttention
findersUpdated
variantsUpdated
}
}

Variables:

{
"input": {
"name": "string"
}
}

Response:

{
"data": {
"createProductAttribute": {
"findersNeedingAttention": [
"string"
],
"findersUpdated": [
"string"
],
"variantsUpdated": 0
}
}
}
createProductAttribute(
input: CreateProductAttributeInput!
): ProductAttributeChangeResult!

Arguments​

createProductAttribute.input ● CreateProductAttributeInput! non-null input​

The new attribute.

Type​

ProductAttributeChangeResult object​

What an attribute change did.