Hi All,
Is it possible to create a Bulk Operation with inventory levels for all stores? Currently, I've only been able to get it working for one specific store at a time.
Here's my mutation:
mutation { bulkOperationRunQuery ( query: """ { inventoryItems { edges { node { id inventoryLevel (locationId: "gid://shopify/Location/{LOCATION_ID}") { available id updatedAt } } } } } """ ) { bulkOperation { id status } userErrors { field message } } }
Thanks!
Solved! Go to the solution
This is an accepted solution.
Hey @Conner ,
When you mention fetching inventory levels for all stores, do you mean for all locations in which the inventory items can be stocked? If that is the case, then I believe this is the GraphQL Bulk Operations query you need to run:
mutation { bulkOperationRunQuery( query: """ { inventoryItems { edges { node { id inventoryLevels { edges { node { location { address { address1 address2 city country } id } available id updatedAt } } } } } } } """ ) { bulkOperation { id status } userErrors { field message } } }
Hassain | Developer Support Specialist @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Click Accept as Solution
Hi @hassain - great work on the bulk fetch. I am looking to retrieve the Product SKU - along with the inventory levels - in a single Bulk API fetch. I'll then persist this in a local process - to blend the inventory levels that are retrieved from a warehouse solution. I can then work out the deltas - to push back using the
inventoryBulkAdjustQuantityAtLocation
mutation.
The approach above seems to be the most elegant way to approach using up to date GraphQL API's - but as for the syntax - I would appreciate some direction...
User | Count |
---|---|
14 | |
12 | |
10 | |
8 | |
7 |