Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Multiple locations availability in GraphQL product query

Multiple locations availability in GraphQL product query

geezmo
Visitor
1 0 1

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].myshopify.com/api/2022-10/graphql.json) 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?

Thanks!

Replies 0 (0)