App-data metafields can't store type "list.metaobject_reference"

Hey, I just wanted to check if this issue is on my end or if it’s simply not possible at all.

So, initially, I was able to easily create app-data metafields using the Shopify documentation. Everything worked fine when storing simple values like single_line_text_field, as shown in the docs.

The issue came up when I tried to store a metaobject instead. I attempted to assign the value of a metaobject definition ID, but as expected, that didn’t work. I got the following error:

Value requires that you have a metafield definition with the key: xxxx

After seeing that, I figured okay maybe I need to create a metafield definition first. I tried several things, but I wasn’t sure how this would work specifically with app-data metafields.

I attempted multiple times with different metafield definitions and tried assigning values to those metafields, but it didn’t work.

My main goal with all of this was to be able to use the {{ app.metafields }} Liquid syntax inside my theme extensions.

Any idea if what I’m trying to do is supported? Or am I missing something?

1 Like

Hey @Umit_Demir :waving_hand: Could you share the exact mutation you’re using to create the app-data metafield when the “value requires…” message pops up?

I’m just wondering what type of value type you’re using there. Are you storing the metaobject definition ID as a single_line_text_field or another value?

Usually that error message pops up when a metafield can’t be found (usually because it was deleted or is inaccessible to the app making the request) - hope to hear back from you soon, happy to dig into this further for sure!