Error en GraphQL, ProductVariant (AvailableQuantity)

Error en GraphQL, ProductVariant (AvailableQuantity)

MichaelVai
Visitor
3 0 0

MichaelVai_0-1682603683978.png

I am trying to add to the GraphQL call the AvailableQuantity attribute, but I have not been able to since yesterday.
According to what I have read in the documentation, the attribute is called AvailableQuantity (This same query does work in the GraphQl application).
But if I add this attribute to the query, it breaks.
Attached is a screenshot.

MichaelVai_1-1682603709944.png

 

Replies 4 (4)

ShopifyDevSup
Shopify Staff
1453 238 512

Hi @MichaelVai 👋

 

It's unclear which API version the app is using, but you should be able to use `ProductVariant.inventoryQuantity` field in version 2023-04. The `ProductVariant` object in our oldest stable version doesn't support a `availableQuantity` field.

 

Hope that helps!

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

MichaelVai
Visitor
3 0 0

MichaelVai_0-1682625710712.png

Are you referring to this?
I tried to change versions and got no solution, maybe I had to keep testing and clearing cache.

MichaelVai_1-1682626194483.png

 

MichaelVai
Visitor
3 0 0

MichaelVai_2-1682627157073.png

In general I have already tested both options, I have version 2022-07, and I had already tested inventoryQuantity.
I'm sorry for not saying it before, I also tried to change the version, and the error persisted.
(When changing the version, the call does not work, no matter if the quantity is there or not).

MichaelVai_3-1682627274494.png

@ShopifyDevSup 

ShopifyDevSup
Shopify Staff
1453 238 512

If the query runs successfully in a different API client like GraphiQL or Postman, it may be an issue with how you are making the request.

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog