Solved

Metafield Storefront Visibility Record

WebEnvy
Tourist
6 0 0

Hey Team!

 

Just wondering if anyone can help me with this as I have followed the documentation here:
https://help.shopify.com/en/api/guides/metafields/storefront-api-metafields#expose-metafields-to-the...
and have had no luck. 

 

I am building a storefront using Vue.js and am trying to expose the metafields created by the 'Custom Fields' App to the API

Using the 'Shopify GraphiQL App' in the SHopify admin area I have input the following:

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

with the following Query Vars:

{
  "input": {
    "namespace": "custom_fields",
    "key": "suits",
    "ownerType": "PRODUCT"
  }
}

The error message I get is: "The access token provided does not have access to the supplied ownerType."

While I'm new to the GraphQL (and Shopify) the documentation on the page provided doesn't mention needing to auth using the Admin App.  

 

Any help pointing in the right direction would be appreciated. 

 

Accepted Solution (1)
Nesters
Shopify Partner
19 1 19

This is an accepted solution.

I haven't used Shopify's GraphiQL app in a while so I'm not entirely sure how it's set up.

It seems that you don't have the write access for your credentials that are associated with the Shopify's GraphiQL app.

 

Check your app's access scopes under "Manage private apps" in the Apps section of the Admin.

You can also download Graphiql as standalone app and set up your private app credentials that way.

Remember to set up write access for appropriate access scopes.

 

 

Contact me: mail@nesters.me
Technical solutions / integration / headless ecommerce.
Latest post: Benefits of JAMstack ecommerce

View solution in original post

Replies 16 (16)