A query on App Installation with a valid API key to a store returns an ID:
"data": {
"appInstallation": {
"id": "gid://shopify/AppInstallation/35972"
}
}
I want to make a Storefront API token I have visible via Liquid to my Theme App Extension, so make some calls, so I want to store this token in an App Owned Metafield, thus allowing me to render the Storefront API token in Liquid.
A call to the App Owned Metafield Create returns invalid ID to me. I see no reason for this. What is the secret sauce to setting an App Owned Metafield?
My data to the call is straight out of the docs for the call signature.
{
"metafieldsSetInput": [
{
"namespace": "moon_shot",
"key": "storefront_access_token",
"type": "single_line_text_field",
"value": "gid://shopify/StorefrontAccessToken/1234567",
"ownerId": "gid://shopify/AppInstallation/35972"
}
]
}
The result:
"errors": [
{
"message": "invalid id",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"metafieldsSet"
]
}
],
So what am I doing wrong here? Seems like I am using the correct ID. What is invalid?