Previously, if we used the GraphQL API to try and set inventory at an unconnected location we would get a The specified inventory item is not stocked at the location error if the inventory item was not connected to the location. Now the API seems to allow it but the display in the admin is a little odd. Does any one know if this is an intentional change or something that will be reverted?
I saw some recent changelog posts about inventory levels but I couldn’t find an exact answer.
Setting inventory for unlinked locations
I’m not seeing the The specified inventory item is not stocked at the location error anymore, for example in this query the inventory is not connected to the location, however it succeeds:
mutation {
inventorySetQuantities(input: {
name: "available",
reason: "correction",
quantities: [{
inventoryItemId: "gid://shopify/InventoryItem/47940391403706",
locationId: "gid://shopify/Location/82014863546",
quantity: 123,
changeFromQuantity: null
}]
}) @idempotent(key: "be42e255c039") {
inventoryAdjustmentGroup {
id
changes {
location {
id
name
}
}
}
userErrors {
field
message
code
}
}
}
{
"data": {
"inventorySetQuantities": {
"inventoryAdjustmentGroup": {
"id": "gid://shopify/InventoryAdjustmentGroup/40328111358138",
"changes": [
{
"location": {
"id": "gid://shopify/Location/82014863546",
"name": "A Demo Warehouse"
}
},
{
"location": {
"id": "gid://shopify/Location/82014863546",
"name": "A Demo Warehouse"
}
}
]
},
"userErrors": []
}
}
}
Admin Display
Now, I will see the updated inventory in the admin for A Demo Warehouse, even though the location isn’t connected:
What’s odd to me is that if I run the query above again (with a new idempotent key), the amount gets added to the on-hand total:
However, if the variant is connected to the location, subsequent inventorySetQuantities replace the inventory level, they don’t add to it (which I think makes sense). Is the adding of inventory levels when a location is not connected intentional?
Thanks

