GraphQL ITEM_NOT_STOCKED_AT_LOCATION error - different to REST API

Good afternoon,

The GraphQL mutation inventorySetQuantities returns the ITEM_NOT_STOCKED_AT_LOCATION error if the inventory item is not stocked at the location.
This works differently to the /inventory_levels/set.json REST endpoint, which actually succeeds in this scenario, “silently” activating the location for the inventory item.

I understand that I need to call the inventoryActivate GraphQL mutation to make it work, but I’m interested to find out why the behaviour was changed? Was there a genuine business case to support the change, or was it more about keeping the individual GraphQL mutations more focused?

Thank you!
Piotr

1 Like

Hey @Piotr_Wojcicki,

Looking back through our release notes, this error was introduced in 2023-07. Although no specific business case was shared https://shopify.dev/docs/api/release-notes/previous-versions/2023-07#new-error-code-added-to-inventory-quantity-mutations

My assumption would be as you mentioned, where graphql operations are typically more explicit vs implicit. I’ll ask around and see if I can dig up any more context for you.