Metaobject | json - media displays gid

Short description of issue

See additional info

Link to Shopify Store

N/A

Reproduction steps

N/A

Additional info

Hiya, I’m using the ‘json’ filter on a metaobject so that the data can be used in JS.

This works well for the most part, however media comes out in this format:
“background_image”: “gid://shopify/MediaImage/68497020420478”

This isn’t exactly useful in liquid since you can’t reference an image by ID and it’s the GraphQL ID so even using it in comparisons is annoying.

Is there any chance that this could be updated to instead bring out the image object as it does for i.e. product media? (src, width, height, altText)

What type of topic is this

Feature request

An image is also an object, so this reflection occurs. You can try to extract the image value separately and then replace it using replace.

I mean I “can” and have done a work-around - but surely the | json filter should just do a “deep” conversion and do objects within objects

The GraphQL ID isn’t going to do anyone any good in Liquid..