Storefront api not able to access metafields and returning error.

Jagadeesh1244
New Member
4 0 1

Hi, I am using the Storefront API to get the metafields through Shopify Buy SDK. I have already created metafield 

metafieldStorefrontVisibilityCreate object
 
mutation {
     metafieldStorefrontVisibilityCreate(
         input: {
              namespace: "abc"
              key: "xyz"
              ownerType: PRODUCTVARIANT
         }
     ) {
            metafieldStorefrontVisibility {
            id
        }
userErrors {
         field
         message
      }
    }
}
 
 
very few times I am able to get the requested metafields information but may times I am not able to get the metafields information and giving the error like Uncaught Error: No field of name "metafields" found on type "ProductVariant" in schema. 
Can someone please help on this issue. 
Replies 0 (0)