Conversations about creating, managing, and using metafields to store and retrieve custom data for apps and themes.
I have an app that creates metafield definitions (MFDs from now on) into a namespace called, let's say, "cust_props" using the Admin GQL API. This is not the app namespace and nothing can be done atm otherwise hell will break lose.
The created MFDs are not visible to storefrontAPI at creation time and I am enabling it later, updating the MFD by using the deprecated visibleToStorefrontApi property. The other alternative (that I have not tried yet) would be to use the deprecated metafieldStorefrontVisibilityCreate mutation. Both ways are deprecated and they might get remove one day.
So I have been looking into following the deprecation indication on the visibleToStorefrontApi property and tried to use the access.storefront value.
BUT when I tried to set the access.storefront I was prompted to add the storefront.admin value as well. BUT when I added it I was prompted with an error saying I cannot set the storefront.admin on a namespace I do not own.
Moving the MFDs into the app namespace is not something I can do and because this is not a case I can even consider right now, what can I do? How can I change the visibility of a MFD I created into a namespace other than the app owned one without a deprecated way?
Solved! Go to the solution
This is an accepted solution.
Customer support just confirmed that there's no way around.
MFDs in non-app-owned namespaces would need to be migrated into an app-owned namespace to be able to set the access rights.
The latest API version that supports the deprecated visibleToStorefrontApi property is 2023-10. 😞
Late update. Setting the visibleToStorefrontApi property leads to an error.
Setting access controls on a definition under this namespace is not permitted.
The app has access to the object on which the MFD is created but how can I check the namespace access?
It seems that it is forbidden to do so : https://community.shopify.com/c/shopify-discussions/metafield-definition-and-access-settings-this-is... .
It is either a app owned namespace or it is a manual operation. Good luck with it when you have 22 stores and around 10-15 MFDs!!!
Thanks a lot Shopify!
This is an accepted solution.
Customer support just confirmed that there's no way around.
MFDs in non-app-owned namespaces would need to be migrated into an app-owned namespace to be able to set the access rights.
The latest API version that supports the deprecated visibleToStorefrontApi property is 2023-10. 😞