Custom Metafields Only Accessable Through Admin API?

Custom Metafields Only Accessable Through Admin API?

MaxAUS
Visitor
1 0 1

I am trying to get the value of a custom metafield through the storefront API. The metafield will return 'null' unless I use the Admin API in which case it responds correctly.

 

I have made sure the storefront access option for the metafield definition is on 'Read'.

 

Is this an intended response?

 

 

 

 

{
  shop {
    name
  }
  products(first: 10) {
    edges {
      node {
        title
        metafield(key: "custom.sold_count") {
          value
        }
      }
    }
  }
}

# Response

{
  "data": {
    "shop": {
      "name": "Shop name"
    },
    "products": {
      "edges": [
        {
          "node": {
            "title": "Product name",
            "metafield": null
          }
        }
      ]
    }
  }
}

 

 

 

 

Reply 1 (1)

BetoPiccoli
Shopify Partner
1 0 0

Hi there!

I’m facing the same issue here. I already have a bunch of old fields working correctly when querying from the Storefront API, but new fields are only returning from the Admin API. I’m still using ACF Metafields, but like I said, the fields created previously are working fine.

 

I’ll keep investigating, and if I find anything, I’ll post it here.