How to determine which InventoryItem failed when bulk updating quantity via GraphQL?

Highlighted
Excursionist
29 0 5

Is there any way to tell specifically which InventoryItem failed when bulk updating inventory quantities via GraphQL?

I am working with stores that have a high amount of Products/Variants (think 25,000+ Products & 200,000+ Variants) and multiple Locations. Using the REST API to update inventory has proven to be pretty inefficient. However, bulk updating inventory quantities via the method below doesn't seem to be the greatest solution either, as I have run into scenarios where a Variant has been deleted just before an Inventory Item update was pushed out or there was an Internal Server Error.

Even if I include userErrors, I don't receive a message about which InventoryItem caused the failure-- just that the update failed. In the example below, my experience has been that there is no way to determine if the first InventoryItemID failed vs. the last. Is this true?

mutation {  inventoryBulkAdjustQuantityAtLocation(    locationId: "gid://shopify/Location/{LocationID}",    inventoryItemAdjustments: [
{inventoryItemId: "gid://shopify/InventoryItem/{InventoryItemID}", availableDelta: 1},
{inventoryItemId: "gid://shopify/InventoryItem/{InventoryItemID}", availableDelta: 1},
{inventoryItemId: "gid://shopify/InventoryItem/{InventoryItemID}", availableDelta: 1},
{inventoryItemId: "gid://shopify/InventoryItem/{InventoryItemID}", availableDelta: 1}
]) {
inventoryLevels { available
}
}
}

 

0 Likes
New Member
3 0 0

I'm also with the same problem and would like an answear (won't repost the same question)

0 Likes