A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Thank you for your help.
(Since I am in a situation where I cannot try GraphQL, I asked here)
I would like to update the stock quantity with an absolute number.
Is it possible with the following method?
Example: When updating the stock quantity from "10" to "15"
1. The number of stock is "10"
2. Disable once with "inventoryDeactivate"
3. Activate again with "inventoryActivate" and specify "15" in "available"
Without you explaining more, it is hard to answer. You understand setting absolute numbers no longer makes sense since inventory items and their levels are distributed across locations. Even if you only have one location, you still need to take into account that issue. Plus, when you update your count, you have no idea if items are not there due to them simply being off the shelf and in a cart, soon to be returned without a checkout.
Meaning, go back to the pattern recommened, it does not require GQL anyway. Update your levels with the DELTA change you want to see. If Shopify tells you 10, and you have 15, your delta is +5, and you can use RestAPI to indeed provide that item, at that location with a delta of +5.
Setting absolute numbers, IMO, was left behind 6 years ago or so...