Update Item

Use the updateItem mutation to update any existing items.

Mutation

updateItem(input: UpdateCartItemInput!): Cart!

UpdateCartItemInput

ArgumentTypeDescription
cartIdID!The id of the cart the item belongs to
idID!The id of the item you are updating
nameStringSet a new item name
descriptionStringSet a new item description
priceIntSet a new unit price
quantityIntSet a new quantity
metadataJsonCustom meta object

Example

mutation {
  updateItem(
    input: {
      cartId: "ck5r8d5b500003f5o2aif0v2b"
      id: "5e3293a3462051"
      quantity: 2
    }
  ) {
    id
    totalItems
    subTotal {
      formatted
    }
  }
}