Conversations about creating, managing, and using metafields to store and retrieve custom data for apps and themes.
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hi,
we are using metafields to store data and on the other end read it from a headless Storefront. Using a metafield definition we give permission to read the metafield using the storefront API:
{ "data": { "metafieldDefinitionCreate": { "createdDefinition": { "id": "gid://shopify/MetafieldDefinition/3456", "validationStatus": "ALL_VALID", "name": "Test text", "namespace": "app--123--hello", "key": "test-url", "access": { "storefront": "PUBLIC_READ", "admin": "MERCHANT_READ_WRITE" } }, "userErrors": [] } } }
After setting a metafield value, we want to also translate this value to different languages, using the following mutation:
mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) { translationsRegister(resourceId: $resourceId, translations: $translations) { translations { key locale outdated value } userErrors { field message } } }
Variables:
{ "resourceId": "gid://shopify/Metafield/3456", "translations": [ { "key": "value", "locale": "fr", "translatableContentDigest": "some-hash", "value": "Translated value" } ] }
But all we get is that the metafield was not found:
{ "data": { "translationsRegister": { "translations": null, "userErrors": [ { "field": [ "resourceId" ], "message": "Resource gid://shopify/Metafield/3456 does not exist" } ] } } }
When removing the app reserved namespace, everything is working as expected. Is this a known bug?
Solved! Go to the solution
This is an accepted solution.
This has been fixed. Thank you!
This is an accepted solution.
This has been fixed. Thank you!