I’m creating a shopify app with a Checkout UI extension. This extension will run for each line item and perform a logic to display a flag notification.
I need to access the locations of each product to perform my validation logic. I’m using the below query:
query GetProductLocations($productId: ID!) {
product(id: $productId) {
variants(first: 10) {
nodes {
inventoryItem {
inventoryLevels(first: 10) {
edges {
node {
location {
id
name
}
available
}
}
}
}
}
}
}
}
But, when I run this query using fetch, I’m receiving the error '“Field ‘inventoryItem’ doesn’t exist on type ‘ProductVariant’”.
Accordingly with the documentation (ProductVariant - GraphQL Admin), the field exists in API version 2025-04.
What can I do?