Menu
updateTypeDefinition
Update an existing type definition — pass its current version and an array of update actions.
Use it in a workflow
- Add a step and choose the Commercetools connector.
- Pick the updateTypeDefinition action (under Update).
- Fill in the fields below, then reference the result from later steps as
{{updatetypedefinition.response.data}}.
Query
This is the mutation the action sends by default. Edit it in the step's Query field to change which fields come back.
mutation UpdateTypeDefinition($version: Long!, $actions: [TypeUpdateAction!]!, $id: String, $key: String) {
updateTypeDefinition(version: $version, actions: $actions, id: $id, key: $key) {
key
nameAllLocales {
locale
value
}
descriptionAllLocales {
locale
value
}
resourceTypeIds
id
version
createdAt
lastModifiedAt
createdBy {
isPlatformClient
clientId
externalUserId
anonymousId
customerRef {
typeId
id
}
userRef {
typeId
id
}
associateRef {
typeId
id
}
attributedTo {
clientId
source
userRef
}
}
lastModifiedBy {
isPlatformClient
clientId
externalUserId
anonymousId
customerRef {
typeId
id
}
userRef {
typeId
id
}
associateRef {
typeId
id
}
attributedTo {
clientId
source
userRef
}
}
}
}
Variables
Pass these as a JSON object in the step's Variables field.
{
"version": "string",
"actions": [
{
"addEnumValue": {
"fieldName": "string",
"value": "string"
},
"addFieldDefinition": {
"fieldDefinition": "string"
},
"addLocalizedEnumValue": {
"fieldName": "string",
"value": "string"
},
"changeEnumValueLabel": {
"fieldName": "string",
"value": "string"
},
"changeEnumValueOrder": {
"fieldName": "string",
"keys": "string"
},
"changeLabel": {
"fieldName": "string",
"label": "string"
},
"changeFieldDefinitionOrder": {
"fieldNames": "string"
},
"changeInputHint": {
"fieldName": "string",
"inputHint": "string"
},
"changeLocalizedEnumValueLabel": {
"fieldName": "string",
"value": "string"
},
"changeLocalizedEnumValueOrder": {
"fieldName": "string",
"keys": "string"
},
"changeKey": {
"key": "string"
},
"changeName": {
"name": "string"
}
}
],
"id": "string",
"key": "string"
}
Response
Read the result with {{updatetypedefinition.response.data.data.updateTypeDefinition}}. If the API returns errors, the step fails and they are at {{updatetypedefinition.response.data.errors}}.
Need more? See the Commercetools guide for connection setup and behaviour shared by every action.
Was this page helpful?