All Release Notes

ShoppingLists GraphQL mutations

19 November 2019
Enhancement
CartsGraphQL
  • [GraphQL API] Added the following types to the GraphQL schema: AddShoppingListLineItem, AddShoppingListTextLineItem, ChangeShoppingListLineItemQuantity, ChangeShoppingListLineItemsOrder, ChangeShoppingListName, ChangeShoppingListTextLineItemName, ChangeShoppingListTextLineItemQuantity, ChangeShoppingListTextLineItemsOrder, MyShoppingListDraft, MyShoppingListUpdateAction, RemoveShoppingListLineItem, RemoveShoppingListTextLineItem, SetShoppingListAnonymousId, SetShoppingListCustomField, SetShoppingListCustomType, SetShoppingListCustomer, SetShoppingListDeleteDaysAfterLastModification, SetShoppingListDescription, SetShoppingListKey, SetShoppingListLineItemCustomField, SetShoppingListLineItemCustomType, SetShoppingListSlug, SetShoppingListTextLineItemCustomField, SetShoppingListTextLineItemCustomType, SetShoppingListTextLineItemDescription, ShoppingListDraft, ShoppingListLineItemDraft, ShoppingListUpdateAction, TextLineItemDraft.
  • [GraphQL API] Changed the Mutation type:
    • Added the updateMyShoppingList field to the Mutation type.
    • Added the createShoppingList field to the Mutation type.
    • Added the deleteShoppingList field to the Mutation type.
    • Added the createMyShoppingList field to the Mutation type.
    • Added the updateShoppingList field to the Mutation type.
    • Added the deleteMyShoppingList field to the Mutation type.

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

extend type Mutation {
createMyShoppingList(draft: MyShoppingListDraft!): ShoppingList
createShoppingList(draft: ShoppingListDraft!): ShoppingList
deleteMyShoppingList(id: String!, version: Long!): ShoppingList
deleteShoppingList(version: Long!, personalDataErasure: Boolean = false,
"Queries with specified ID"
id: String,
"Queries with specified key"
key: String): ShoppingList
updateMyShoppingList(id: String!, version: Long!, actions: [MyShoppingListUpdateAction!]!): ShoppingList
updateShoppingList(version: Long!, actions: [ShoppingListUpdateAction!]!,
"Queries with specified ID"
id: String,
"Queries with specified key"
key: String): ShoppingList
}
input AddShoppingListLineItem {
addedAt: DateTime
custom: CustomFieldsDraft
quantity: Int = 1
variantId: Int
sku: String
productId: String
}
input AddShoppingListTextLineItem {
addedAt: DateTime
custom: CustomFieldsDraft
quantity: Int = 1
description: [LocalizedStringItemInputType!]
name: [LocalizedStringItemInputType!]!
}
input ChangeShoppingListLineItemQuantity {
lineItemId: String!
quantity: Int!
}
input ChangeShoppingListLineItemsOrder {
lineItemOrder: [String!]!
}
input ChangeShoppingListName {
name: [LocalizedStringItemInputType!]!
}
input ChangeShoppingListTextLineItemName {
textLineItemId: String!
name: [LocalizedStringItemInputType!]!
}
input ChangeShoppingListTextLineItemQuantity {
textLineItemId: String!
quantity: Int!
}
input ChangeShoppingListTextLineItemsOrder {
textLineItemOrder: [String!]!
}
input MyShoppingListDraft {
name: [LocalizedStringItemInputType!]!
description: [LocalizedStringItemInputType!]
lineItems: [ShoppingListLineItemDraft!] = []
textLineItems: [TextLineItemDraft!] = []
custom: CustomFieldsDraft
deleteDaysAfterLastModification: Int
}
input MyShoppingListUpdateAction {
addLineItem: AddShoppingListLineItem
addTextLineItem: AddShoppingListTextLineItem
changeLineItemQuantity: ChangeShoppingListLineItemQuantity
changeLineItemsOrder: ChangeShoppingListLineItemsOrder
changeName: ChangeShoppingListName
changeTextLineItemName: ChangeShoppingListTextLineItemName
changeTextLineItemQuantity: ChangeShoppingListTextLineItemQuantity
changeTextLineItemsOrder: ChangeShoppingListTextLineItemsOrder
removeLineItem: RemoveShoppingListLineItem
removeTextLineItem: RemoveShoppingListTextLineItem
setCustomField: SetShoppingListCustomField
setCustomType: SetShoppingListCustomType
setDeleteDaysAfterLastModification: SetShoppingListDeleteDaysAfterLastModification
setDescription: SetShoppingListDescription
setLineItemCustomField: SetShoppingListLineItemCustomField
setLineItemCustomType: SetShoppingListLineItemCustomType
setTextLineItemCustomField: SetShoppingListTextLineItemCustomField
setTextLineItemCustomType: SetShoppingListTextLineItemCustomType
setTextLineItemDescription: SetShoppingListTextLineItemDescription
}
input RemoveShoppingListLineItem {
lineItemId: String!
quantity: Int
}
input RemoveShoppingListTextLineItem {
textLineItemId: String!
quantity: Int
}
input SetShoppingListAnonymousId {
anonymousId: String
}
input SetShoppingListCustomField {
name: String!
value: String
}
input SetShoppingListCustomType {
fields: [CustomFieldInput!]
type: ResourceIdentifierInput
typeKey: String
typeId: String
}
input SetShoppingListCustomer {
customer: ResourceIdentifierInput
}
input SetShoppingListDeleteDaysAfterLastModification {
deleteDaysAfterLastModification: Int
}
input SetShoppingListDescription {
description: [LocalizedStringItemInputType!]
}
input SetShoppingListKey {
key: String
}
input SetShoppingListLineItemCustomField {
lineItemId: String!
name: String!
value: String
}
input SetShoppingListLineItemCustomType {
lineItemId: String!
fields: [CustomFieldInput!]
type: ResourceIdentifierInput
typeKey: String
typeId: String
}
input SetShoppingListSlug {
slug: [LocalizedStringItemInputType!]
}
input SetShoppingListTextLineItemCustomField {
textLineItemId: String!
name: String!
value: String
}
input SetShoppingListTextLineItemCustomType {
textLineItemId: String!
fields: [CustomFieldInput!]
type: ResourceIdentifierInput
typeKey: String
typeId: String
}
input SetShoppingListTextLineItemDescription {
textLineItemId: String!
description: [LocalizedStringItemInputType!]
}
input ShoppingListDraft {
name: [LocalizedStringItemInputType!]!
description: [LocalizedStringItemInputType!]
lineItems: [ShoppingListLineItemDraft!] = []
textLineItems: [TextLineItemDraft!] = []
custom: CustomFieldsDraft
deleteDaysAfterLastModification: Int
key: String
customer: ResourceIdentifierInput
slug: [LocalizedStringItemInputType!]
anonymousId: String
}
input ShoppingListLineItemDraft {
productId: String
sku: String
variantId: Int
quantity: Int = 1
custom: CustomFieldsDraft
addedAt: DateTime
}
input ShoppingListUpdateAction {
addLineItem: AddShoppingListLineItem
addTextLineItem: AddShoppingListTextLineItem
changeLineItemQuantity: ChangeShoppingListLineItemQuantity
changeLineItemsOrder: ChangeShoppingListLineItemsOrder
changeName: ChangeShoppingListName
changeTextLineItemName: ChangeShoppingListTextLineItemName
changeTextLineItemQuantity: ChangeShoppingListTextLineItemQuantity
changeTextLineItemsOrder: ChangeShoppingListTextLineItemsOrder
removeLineItem: RemoveShoppingListLineItem
removeTextLineItem: RemoveShoppingListTextLineItem
setAnonymousId: SetShoppingListAnonymousId
setCustomField: SetShoppingListCustomField
setCustomType: SetShoppingListCustomType
setCustomer: SetShoppingListCustomer
setDeleteDaysAfterLastModification: SetShoppingListDeleteDaysAfterLastModification
setDescription: SetShoppingListDescription
setKey: SetShoppingListKey
setLineItemCustomField: SetShoppingListLineItemCustomField
setLineItemCustomType: SetShoppingListLineItemCustomType
setSlug: SetShoppingListSlug
setTextLineItemCustomField: SetShoppingListTextLineItemCustomField
setTextLineItemCustomType: SetShoppingListTextLineItemCustomType
setTextLineItemDescription: SetShoppingListTextLineItemDescription
}
input TextLineItemDraft {
name: [LocalizedStringItemInputType!]!
description: [LocalizedStringItemInputType!]
quantity: Int = 1
custom: CustomFieldsDraft
addedAt: DateTime
}