“Several fields on the Storefront API were marked as deprecated” for my store

“Several fields on the Storefront API were marked as deprecated” for my store

Ellen_Ele
Shopify Partner
8 0 1

Hi,

I’m using this code in my store:

 

  var client = ShopifyBuy.buildClient({
    domain: '***namesite***.myshopify.com',
    storefrontAccessToken: ‘***CODE***'
  });
  var productTitle = $('.product-area__details__title').text();
  client.product.fetchQuery(
    {query: 'title:*'+productTitle+'*'}
  ).then(function(products) {
    // Your product is at products[0] if successful
    //console.log(products[1].variants[0].available);
    $.each(products, function(key, value) {
      var titleVariant = value.variants[0].title;
      var inventory_quantity = value.variants[0].available;
      $('.metafields').each(function() {
        var metafields = $(this);
        var metafieldsValue = $(this).attr('data-order').replace(/\s/g,'');
        if(metafieldsValue == titleVariant) {
          if(inventory_quantity == false) {
            metafields.addClass("unavailable");
          }
        }
      });
    });
  });

 

In this documentation https://shopify.dev/changelog/cleaning-up-deprecations-in-the-storefront-api, it indicates that the “ProductVariant.available” is deprecated.
I cannot understand if what I use in my javascript code (value.variants[0].available) is this indicated value (“ProductVariant.available”).

 

Is the same value?

 

 

Also I received an email from Shopify that said:

"One or more of your custom apps have made deprecated API calls in the last 30 days. Support for these versions will be removed on January 1, 2023 to allow for continued infrastructure improvements. Please update the apps listed below to
API version 2022–07 or later to ensure they continue to function correctly:

Breaking changes affecting Storefront

  • Several fields on the Storefront API were marked as deprecated"

 

Could this interfere with the above code in any way?

 

 

Thanks

Reply 1 (1)

CJ_3___________
Visitor
1 0 0

Yeah, I'm having the same issue, for some reason I don't have access to the metafields anymore in our store!