Conversations about creating, managing, and using metafields to store and retrieve custom data for apps and themes.
When creating metafield definitions using metafieldDefinitionCreate we can select different ownerType arguments like SHOP. Furthermore, we can describe the access mode, to let merchants see and modify these metafield values using admin.MERCHANT_READ_WRITE. When creating a metafield definition though using the API and owner type SHOP the admin does not show any Shop metafield definitions as seen here:
For other owner types this works as expected, though not for Shop metafield definitions. Is this a known limitation?
Solved! Go to the solution
This is an accepted solution.
Hi Ocastx - that lack of a UI on the admin for SHOP metafields is a known limitation, unfortunately there's no timeline for implementing this at the moment.
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Hi Ocastx,
I've asked the custom data team about this and will report back what I hear.
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
To piggy back off of this, I'm trying to access SHOP metafields via the Storefront API; however, the metafield namespace and key are returning null.
https://shopify.dev/docs/api/storefront/2024-01/queries/shop
To piggyback off of this, I'm trying to access SHOP metafields via the Storefront API; however, the metafield namespace and key are returning null.
https://shopify.dev/docs/api/storefront/2024-01/queries/shop
This is an accepted solution.
Hi Ocastx - that lack of a UI on the admin for SHOP metafields is a known limitation, unfortunately there's no timeline for implementing this at the moment.
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Hey Liam, thanks for the quick update – appreciate it!
Just so that I understand it right: SHOP metafields are still safe to use though, there is just no UI for the merchant to edit those in admin. Is that correct?
Exactly - there's no risk in using them via the API, there's just no UI for them for merchants to interact with.
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Hi Liam, would you happen to have an update on this yet? A timeline perhaps? I have built multiple websites using the functionality of shop level metafields and since the obligatory creation of definitions to expose them to the front API and no way to do that for SHOP level metafields using the AI, this is truly a pain in the ass, pardon my language.
*using the UI i meant 🙂
Can you please explain , how to set Values to metafields with ownertype : SHOP
mutation MetafieldsSet($metafields: [MetafieldsSetInput!]!) {
metafieldsSet(metafields: $metafields) {
metafields {
key
namespace
value
ownerType
createdAt
updatedAt
}
userErrors {
field
message
code
}
}
}
{
"metafields":
{
"key": "haSsubscripn",
"namespace": "supscriptionstat",
"ownerId": ""
"ownerType": "SHOP",
"type": "boolean",
"value": "true"
}
}
What is the ownerId we have to pass.? Please explain