Skip to content

Catalog Attribute Options — Create / Update / Delete

GraphQL counterpart to the REST attribute-options endpoints.

Operations

OperationTypePurpose
createAdminAttributeOptionMutationAdd an option to a select/multiselect/checkbox attribute
updateAdminAttributeOptionMutationPartial update of an option
deleteAdminAttributeOptionMutationRemove an option

All three mutations carry extra args alongside input:

  • attributeId: Int! — required on every mutation
  • optionId: Int! — required on update and delete

Input — Create / Update

FieldTypeNotes
admin_nameStringInternal admin label (required on create)
sort_orderIntDisplay order
swatch_valueStringHex color / image path / display text depending on swatch type
translationsJSONMap of locale → { label }

Errors

ConditionMessage
Attribute is not select/multiselect/checkboxThis attribute type does not support options.
Delete refused — option in useThis option is used by N product(s) and cannot be deleted.
Unknown idAttribute option not found.

Released under the MIT License.