Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

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

[Bug] Translating app reserved metafields throws "Metafield not found"

Solved

[Bug] Translating app reserved metafields throws "Metafield not found"

ocastx
Shopify Partner
31 6 13

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? 

 

Accepted Solution (1)

ocastx
Shopify Partner
31 6 13

This is an accepted solution.

This has been fixed. Thank you!

View solution in original post

Reply 1 (1)

ocastx
Shopify Partner
31 6 13

This is an accepted solution.

This has been fixed. Thank you!