A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
I am trying to update product variants inventory stock through productUpdate via:
"mutation ($input: ProductInput!) { productUpdate (input: $input) { product { id } } }"
where input is:
{"title"=>"product", "vendor"=>"pr", :options=>"Produkt",
:variants=>[{"price"=>"11.00",
:compareAtPrice=>nil,
"sku"=>"1111",
:options=>"*** ***",
"barcode"=>"1111",
:inventoryPolicy=>"CONTINUE",
:inventoryItem=>{:cost=>"6.49", :tracked=>true},
:inventoryQuantities=>{:availableQuantity=>85,
:locationId=>"gid://shopify/Location/60120137888"}}],
:id=>"gid://shopify/Product/6622178770997"}
And as result, in the admin panel, I receive available quantity -41
How it is possible to send 85 and get -41 ?
Everything else updates right.
Solved! Go to the solution
This is an accepted solution.
Sovled. It was the wrong location id. Still, a mystery why quantity became minus value with a wrong location id, and there were no errors.
This is an accepted solution.
Sovled. It was the wrong location id. Still, a mystery why quantity became minus value with a wrong location id, and there were no errors.