query = <<~QUERY
mutation {
inventoryAdjustQuantities(
input: {reason: "correction", name: "available", changes: [{inventoryItemId: "gid://shopify/InventoryItem/#{inventory_item_id}", delta: #{available}, locationId: #{location}}]}
) {
inventoryAdjustmentGroup {
createdAt
reason
changes {
name
delta
}
}
userErrors {
field
message
}
}
}
QUERY
Here delta i've got -23. This means that the available quantity of that product in inventory will decrease by 23 from 158, and will update to 135. However, the available quantity will not be updated.
Have any solution for this kind of problem?
Solution:-
Previously I’ve sent #{location} → gid://shopify/Location/location_id like this, Now I changed it to a string format like:- “gid://shopify/Location/location_id”