All Release Notes

Types GraphQL mutations

17 February 2020
Composable Commerce
HTTP API
Enhancement
ExtensibilityGraphQL

Types can now be created, updated, and deleted via GraphQL API also.

  • [GraphQL API] Added the following types to the GraphQL schema: AddTypeEnumValue, AddTypeFieldDefinition, AddTypeLocalizedEnumValue, ChangeTypeEnumValueLabel, ChangeTypeEnumValueOrder, ChangeTypeFieldDefinitionOrder, ChangeTypeInputHint, ChangeTypeKey, ChangeTypeLabel, ChangeTypeLocalizedEnumValueLabel, ChangeTypeLocalizedEnumValueOrder, ChangeTypeName, EnumValueInput, FieldDefinitionInput, FieldTypeEnumTypeDraft, FieldTypeInput, FieldTypeLocalizedEnumTypeDraft, FieldTypeReferenceTypeDraft, FieldTypeSetTypeDraft, RemoveTypeFieldDefinition, SetTypeDescription, SimpleFieldTypeDraft, TypeDefinitionDraft, TypeUpdateAction.
  • [GraphQL API] Changed the Mutation type:
    • Added the updateTypeDefinition field to the Mutation type.
    • Added the createTypeDefinition field to the Mutation type.
    • Added the deleteTypeDefinition field to the Mutation type.

Introduced the following changes to the GraphQL schema (in SDL format):

extend type Mutation {
createTypeDefinition(draft: TypeDefinitionDraft!): TypeDefinition
deleteTypeDefinition(version: Long!,
"Queries with specified ID"
id: String,
"Queries with specified key"
key: String): TypeDefinition
updateTypeDefinition(version: Long!, actions: [TypeUpdateAction!]!,
"Queries with specified ID"
id: String,
"Queries with specified key"
key: String): TypeDefinition
}
input AddTypeEnumValue {
fieldName: String!
value: EnumValueInput!
}
input AddTypeFieldDefinition {
fieldDefinition: FieldDefinitionInput!
}
input AddTypeLocalizedEnumValue {
fieldName: String!
value: LocalizedEnumValueInput!
}
input ChangeTypeEnumValueLabel {
fieldName: String!
value: EnumValueInput!
}
input ChangeTypeEnumValueOrder {
fieldName: String!
keys: [String!]!
}
input ChangeTypeFieldDefinitionOrder {
fieldNames: [String!]!
}
input ChangeTypeInputHint {
fieldName: String!
inputHint: TextInputHint!
}
input ChangeTypeKey {
key: String!
}
input ChangeTypeLabel {
fieldName: String!
label: [LocalizedStringItemInputType!]!
}
input ChangeTypeLocalizedEnumValueLabel {
fieldName: String!
value: LocalizedEnumValueInput!
}
input ChangeTypeLocalizedEnumValueOrder {
fieldName: String!
keys: [String!]!
}
input ChangeTypeName {
name: [LocalizedStringItemInputType!]!
}
input EnumValueInput {
key: String!
label: String!
}
input FieldDefinitionInput {
type: FieldTypeInput!
name: String!
label: [LocalizedStringItemInputType!]!
required: Boolean!
inputHint: TextInputHint!
}
input FieldTypeEnumTypeDraft {
values: [EnumValueInput!]!
}
input FieldTypeInput {
Set: FieldTypeSetTypeDraft
String: SimpleFieldTypeDraft
LocalizedString: SimpleFieldTypeDraft
Number: SimpleFieldTypeDraft
Money: SimpleFieldTypeDraft
Date: SimpleFieldTypeDraft
Time: SimpleFieldTypeDraft
DateTime: SimpleFieldTypeDraft
Boolean: SimpleFieldTypeDraft
Enum: FieldTypeEnumTypeDraft
LocalizedEnum: FieldTypeLocalizedEnumTypeDraft
Reference: FieldTypeReferenceTypeDraft
}
input FieldTypeLocalizedEnumTypeDraft {
values: [LocalizedEnumValueInput!]!
}
input FieldTypeReferenceTypeDraft {
referenceTypeId: String!
}
input FieldTypeSetTypeDraft {
elementType: FieldTypeSetTypeDraft!
}
input RemoveTypeFieldDefinition {
fieldName: String!
}
input SetTypeDescription {
description: [LocalizedStringItemInputType!]
}
input SimpleFieldTypeDraft {
dummy: String
}
input TypeDefinitionDraft {
key: String!
name: [LocalizedStringItemInputType!]!
description: [LocalizedStringItemInputType!]
resourceTypeIds: [String!]!
fieldDefinitions: [FieldDefinitionInput!]
}
input TypeUpdateAction {
addEnumValue: AddTypeEnumValue
addFieldDefinition: AddTypeFieldDefinition
addLocalizedEnumValue: AddTypeLocalizedEnumValue
changeEnumValueLabel: ChangeTypeEnumValueLabel
changeEnumValueOrder: ChangeTypeEnumValueOrder
changeLabel: ChangeTypeLabel
changeFieldDefinitionOrder: ChangeTypeFieldDefinitionOrder
changeInputHint: ChangeTypeInputHint
changeLocalizedEnumValueLabel: ChangeTypeLocalizedEnumValueLabel
changeLocalizedEnumValueOrder: ChangeTypeLocalizedEnumValueOrder
changeKey: ChangeTypeKey
changeName: ChangeTypeName
removeFieldDefinition: RemoveTypeFieldDefinition
setDescription: SetTypeDescription
}