Tags:
- Admin GraphQL API
- 2026-01
New changeFromQuantity field to manage inventory
changeFromQuantity field to manage inventoryThis changelog relates to concurrency protection features.
The following mutations now support the optional field:
: Available on theinput type: Available on theinput type: Available on theinput type: Available on the InventoryAdjustmentInput type, which is available on thefield of thetype
Note: The
field of themutation will only be public in version2026-01.
How to use the field
The field is useful to keep inventory data accurate, even if multiple updates are happening at the same time. If the actual quantity doesn't match the value you provide, the mutation will fail with a error, preventing unintended overwrites.
In the following example, the adjustment only succeeds if the current available quantity is 50. If another process has modified the quantity in the meantime, you'll receive an error and can retry with the updated value. To opt-out of comparison checks you can explicitly pass in null to the field.
mutation {
inventoryAdjustQuantities(
input: {
reason: "correction"
name: "available"
changes: [{
delta: 10
changeFromQuantity: 50
inventoryItemId: "gid://shopify/InventoryItem/123"
locationId: "gid://shopify/Location/456"
}]
}
) {
inventoryAdjustmentGroup {
id
}
userErrors {
code
message
}
}
}
For more information on compare and swap, and when you should opt out of comparison checks, refer to our docs. We encourage users to avoid opting-out unless it's justified by their use case.