Weird in that I can’t figure out what’s actually wrong.
Here’s the current inventory status:
{"log":{"data":{"inventoryItem":{"id":"gid://shopify/InventoryItem/48756460355841","inventoryLevel":{"id":"gid://shopify/InventoryLevel/104683962625?inventory_item_id=48756460355841","quantities":[{"name":"available","quantity":1},{"name":"reserved","quantity":0}]}}},"extensions":{"cost":{"requestedQueryCost":3,"actualQueryCost":3,"throttleStatus":{"maximumAvailable":4000.0,"currentlyAvailable":3997,"restoreRate":200.0}}}}}
So, available = 1, reserved = 0. Matches gui.
mutation {
inventoryMoveQuantities(
input: {
reason: "movement_created"
referenceDocumentUri: "gid://shopify/Order/6918637519105"
changes: [
{
inventoryItemId: "gid://shopify/InventoryItem/48756460355841"
quantity: 1
from: {
locationId: "gid://shopify/Location/68409327873"
name: "available"
changeFromQuantity: 1
}
to: {
locationId: "gid://shopify/Location/68409327873"
name: "reserved"
ledgerDocumentUri: "gid://mechanic/EventRun/0db90f82-2df5-439f-a964-2346147f680d"
changeFromQuantity: 0
}
}
]
}
) {
inventoryAdjustmentGroup {
reason
changes {
name
delta
item {
id
sku
}
location {
name
}
}
}
userErrors {
code
field
message
}
}
}
Moving 1 from available to reserved, passing qtys as above. This exact code works for other skus, but this one’s giving this error….
`GraphQL operation returned userErrors:
{
“inventoryMoveQuantities”: {
“inventoryAdjustmentGroup”: null,
“userErrors”: [
{
“code”: “CHANGE_FROM_QUANTITY_STALE”,
“field”: [
“input”,
“changes”,
“0”,
“to”,
“changeFromQuantity”
],
“message”: “The changeFromQuantity argument no longer matches the persisted quantity.”
}
]
}
}`
As if reserved’s changeFromQuantity is incorrect? Like how? Any ideas what’s going on?
EDIT: Might be because reserve qty had never been used before. Using changeFromQuantity: null worked, and then future edits with the actual qty number work fine. What gives?