Multiple locations availability in GraphQL product query

1 0 0

Hello! We have 3 soon-to-be-5 markets configured (Italy, Spain, France) and soon we'll have separate warehouses for all different countries. We have a custom headless storefront and we use Shopify GraphQL API to retrieve information about the products. At the moment, we use the product() query (endpoint:  https://[store-name] with the inContext directive to set the right market, to get what we need, and we use quantityAvailable attribute to see if a product is available or not. Unfortunately, that number is the sum of all the products available across all warehouses / locations, so it will become useless when we will switch to multiple warehouses / locations. I would like to know how to get via GraphQL query the information about the real quantity available for a product in a certain location (linked to a specific country), E.G. with a specific warehouse location set for Spain and a specific quantity set for a certain product in Spain, if I call the `product()` query with inContext country attribute set to "ES" I would like to get the correct availability for that specific warehouse, and not the quantities across all locations.

Any clues?


Replies 0 (0)