Skip to main content

attributesUpdateDefinition

Renames, describes, archives or restores a custom field of one kind of record. Only the arguments given change.

Business Rules​

  • The definition is looked up within the company in the X-Company-Id header and the kind of record in entityType
  • The name and the handle stay unique among the company’s definitions for that kind of record, archived ones included
  • delete: true archives the definition and hides its values; restore: true brings them back, and the two cannot be combined
  • delete: true is applied before the rest of the request: a field that cannot be null is still rejected, and every other value sent with it is discarded without being checked
  • attributeType and entityType cannot be changed

Error Scenarios​

  • **BAD_REQUEST**: the definition belongs to another company or another kind of record, or no change is given at all
  • **BAD_REQUEST**: delete and restore are both true, a definition that is not archived is restored, or an archived definition is archived again
  • **BAD_REQUEST**: the name or the handle is blank, too long, malformed, or held by another definition, or the attribute group is longer than 100 characters
  • **BAD_REQUEST**: name, handle or one of the three settings is sent as null, which is rejected rather than ignored, and before delete is considered
  • **CompanyContextRequired**: no company is in context

Permissions Required​

  • The update permission of the entity type, such as products:update_attribute_definition for PRODUCT
attributesUpdateDefinition(
input: AttributesUpdateDefinitionInput!
): AttributeDefinition!

Arguments​

attributesUpdateDefinition.input ● AttributesUpdateDefinitionInput! non-null input common​

Parameters for AttributesUpdateDefinition

Type​

AttributeDefinition object common​

A custom field that can be set on a record, such as “Material” on a product.