Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
Hello my dev fellows,
Im working on mobile app using StoreFront API and i'm not able to get the avaialableQuantity property for each variant, I found this link https://shopify.dev/changelog/inventory-quantity-available-on-storefront-graphql-api, but there is no thing such as the "inventory quantity" checkbox meanwhile there is a "unauthenticated_read_product_inventory" checkbox. i checked it as mentioned here https://shopify.dev/docs/storefront-api/reference/object/productvariant?api[version]=2020-04. Still no luck same error :
Field 'quantityAvailable' doesn't exist on type 'ProductVariant'
Im stuck as the property is very important to decide whether the product is available for certain quantity or not.
Any help would be greatly appreciated
Solved! Go to the solution
This is an accepted solution.
If you are utilizing version 2020-4 and have granted the permission unauthenticated_read_product_inventory access scope
you should have no problem accessing this information from the Storefront API. Here is an example query:
query { products(first:1) { edges { node { variants(first:1) { edges { node { availableForSale quantityAvailable } } } title id publishedAt } } } }
To learn more visit the Shopify Help Center or the Community Blog.
We have the exact same problem.
It seem to be a bug into the api 😢
Did you find a solution?
I think the only workaround is to use Shopify Admin api 😬
This is an accepted solution.
If you are utilizing version 2020-4 and have granted the permission unauthenticated_read_product_inventory access scope
you should have no problem accessing this information from the Storefront API. Here is an example query:
query { products(first:1) { edges { node { variants(first:1) { edges { node { availableForSale quantityAvailable } } } title id publishedAt } } } }
To learn more visit the Shopify Help Center or the Community Blog.