I am using StoreFront API call to get Metaobject entries. One of the fields is of a type file (image). When I call the GRAPHQL with below call. I am getting all the fields but getting image as gid reference. I wan actual cdn url which I am not able to find anywhere in the shopify documentation. Below is the query which I have tried.
What I want to achieve is to get image/file url but it is returning gid reference.
POST: https://alg-demo-store.myshopify.com/api/unstable/graphql.json
Code I tried:
query {
metaobjects(type: "where_to_buy" first: 10) {
nodes{
id
handle
country: field(key: "country") { value }
file: field(key: "company_logo") { reference {
... on MediaImage {
previewImage {
originalSrc
url
id
}
}
}
}
}
}
}