Hi,
I would like to get the availability of all my product variants by location, to know whether or not they are available for sale and where.
For this I am calling the storefront API to get my product, and including the storeAvailability field, with the parameter first: X to retrieve all of them.
The query works well, I do get a response, however I only get one location data, even though I have more.
In the admin dashboard, they are all setup the same way with an address and with the option Fulfill online orders from this location enabled.
Here’s the query I am using:
query {
node(id: $id) {
... on ProductVariant {
availableForSale
title
product {
title
}
storeAvailability(first: 100) {
edges {
node {
available
location {
id
name
}
}
}
}
}
}
}
And here’s the response I get:
{
"data": {
"node": {
"availableForSale": true,
"title": "34",
"product": {
"title": "Title"
},
"storeAvailability": {
"edges": [
{
"node": {
"available": true,
"location": {
"id": ID,
"name": "BOUTIQUE LYON"
}
}
}
]
}
}
}
}
I only get one location result, event though on this specific variant, I added 7 of them with or without inventory.
Thanks for the help!