Skip to content

Instantly share code, notes, and snippets.

@petercossey
Created December 2, 2024 09:11
Show Gist options
  • Save petercossey/2bd640ebc5ff95325c024e7092c6d149 to your computer and use it in GitHub Desktop.
Save petercossey/2bd640ebc5ff95325c024e7092c6d149 to your computer and use it in GitHub Desktop.
Fetch inventory for product variants at each location
query productById($productId: Int!) {
site {
product(entityId: $productId) {
id
entityId
name
sku
variants {
edges {
node {
inventory {
byLocation {
edges {
node {
locationEntityCode
availableToSell
}
}
}
}
}
}
}
}
}
}
{
"productId": 111
}
@petercossey
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment