Update Item
Use the updateItem mutation to update any existing items.
Mutation
updateItem(input: UpdateCartItemInput!): Cart!UpdateCartItemInput
| Argument | Type | Description |
|---|---|---|
cartId | ID! | The id of the cart the item belongs to |
id | ID! | The id of the item you are updating |
name | String | Set a new item name |
description | String | Set a new item description |
price | Int | Set a new unit price |
quantity | Int | Set a new quantity |
metadata | Json | Custom meta object |
Example
mutation {
updateItem(
input: {
cartId: "ck5r8d5b500003f5o2aif0v2b"
id: "5e3293a3462051"
quantity: 2
}
) {
id
totalItems
subTotal {
formatted
}
}
}