New inventory attributes not being pulled in js-buy-sdk

Highlighted
New Member
1 0 0

With API version 2020-04, we can finally read inventory data with the Storefront API. My problem is that data is still not being pulled.

 

I'm using the shopify-buy@2.10.0 node package (finally updated today to use 2020-04).

Storefront API and the Read inventory permissions are enabled in the admin.

Using the fetchAll function to pull all products.

 

The data is collected but new fields like totalInventory on the Product and quantityAvailable on ProductVariant are not actually there. Is there another step that needs to be done to get this information?

0 Likes
Highlighted
Shopify Staff
Shopify Staff
1041 140 167

Hey @Wis 

 

The package doesn't have an option to request inventory yet, you'll need to send a custom query:

 

{
  products(first:1) {
    edges {
      node {
        id
        totalInventory
      }
    }
  }
}
Notice; Out of office, replies will be delayed until my return. Thanks!
0 Likes