1
votes

I want to expose the product metafields in shopify to my Storefront API. I am referring to following documentation. https://help.shopify.com/en/api/guides/metafields/storefront-api-metafields

Following is the content of my body

mutation($input: MetafieldStorefrontVisibilityInput!) {     
  metafieldStorefrontVisibilityCreate( input: $input ) {         
    metafieldStorefrontVisibility {             
      id         
    }         
    userErrors {             
      field message         
    }     
  }
}

Following are the GRAPHQL VARIABLES

{
  "input": {
    "namespace": "global",
    "key": "description_tag",
    "ownerType": "PRODUCT"
  }
}

Following is the URL

https://posdev07.myshopify.com/admin/api/2019-07/graphql.json

I get following error when I make the request.

{"errors":{"query":"Required parameter missing or invalid"}}
1

1 Answers

0
votes

I had the same problem, turns out I forgot to add the Content-Type: application/json header to the post request.