Hi!
I’ve been trying to update the quantity of an existing cart line item using the Storefront GraphQL API without success. I get a successful response with the updated cart, except the quantity is unchanged. Interestingly changing the line item attributes in this way works, but changing the quantity does not. Am I missing something? ![]()
Here’s my query:
mutation updateCartLines($cartId: ID!, $lines: [CartLineUpdateInput!]!) {
cartLinesUpdate(cartId: $cartId, lines: $lines) {
userErrors {
code
field
message
}
cart {
id
lines(first: 5) {
edges {
node {
id
quantity
attributes {
key
value
}
}
}
}
}
}
}
Variables:
{
"cartId": "[...]",
"lines":
{
"quantity": 2,
"id": "[...]"
}
}
Response:
{
"data": {
"cartLinesUpdate": {
"userErrors": [],
"cart": {
"id": "[...]",
"lines": {
"edges": [
{
"node": {
"id": "[...]",
"quantity": 1,
"attributes": []
}
}
]
}
}
}
}
}
Thanks in advance!