I’m encountering an issue while using Shopify’s Admin API with GraphQL. When trying to query the inventory levels for a product variant, I get the following error: Field 'availableQuantity' doesn't exist on type 'InventoryLevel'
. I am attempting to access the available stock for my product variants using the following query:
query getInventoryItem($productId: ID!) {
product(id: $productId) {
variants(first: 1) {
edges {
node {
id
inventoryItem {
id
inventoryLevels(first: 1) {
edges {
node {
id
availableQuantity // <-- This is where the error occurs
}
}
}
}
}
}
}
}
}
Could you please clarify whether the field availableQuantity
is still valid or if I need to use a different field to fetch available stock? Any guidance or documentation on the correct approach would be very helpful.
Thank you!"_