Having a bit of an issue with the app metafields. I was under the impression that the app metafields can be created via the MetafieldsSet mutation having the owner set to the AppInstallation/[installation_id].
This appears to work, but when I query the created metafield afterwards I get a null response.
Here is the result of my Metafieldset (request-id: 78abcbac-a342-4e07-97f3-c43575d2d999):
I was able to replicate this behaviour by setting my metafield’s ownerId to my own AppInstallation.
This is the expected behaviour for app-data metafields, which are meant to be retrieved directly from the appIntallation object since they should only be available to the one app.
I will make a note for our developers to look into clarifying the documentation to specify what kinds of metafields are not expected to be returned with the metafield query, but can you try querying for your appInstallation’s metafields with something like this for now?
query {
appInstallation {
metafields(first: 5, namespace: "my_namespace") {
nodes {
id
key
value
}
}
}
}
That sits pretty much at the bottom of the page. I think it should be at the top under the description after.
“Unlike private metafields, you can access app-data metafields using the metafields property on the app object in Liquid.”
“Furthermore, once you’ve created an app-data metafield, it can only be accessed via graphql using the metafield field on the AppInstallation object. Attempting to access the metafield directly through its global id will return a null.”