I have an app extension am working on and added a Product metafields - that of a product ref (custom.upsell). The app extension which I run in dev mode, shows up correctly in my block editor and all works fine if I use say an integer value but when I choose the metafield to be a product I cannot fetch the data such as the title.
According to many posts once could get say the title as:
{% assign upsell = product.metafields.custom.upsell.value %}
{{ upsell.title }}
But that is blank. I have been at this for hours and tried sooooo many variations. I can get the "gid://…’ printed and type which is a product_reference. Some posts say to use all_products[…] but thats a no go as well.
This problem is seen in other posts that say you need to update the graphQL query to fetch the desired fields but since this is an app extension I am not working with this.
I just tried directly in theme same result:
{% assign upsell = product.metafields.custom.upsell.value %}
<h2> {{ upsell.title }}</h2>
Any ideas?