How to get file image url in graphql for a Metaobject

How to get file image url in graphql for a Metaobject


0

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.

POST: https://alg-demo-store.myshopify.com/api/unstable/graphql.json

query {
  metaobjects(type: "where_to_buy" first: 10) { 
      
      nodes{
          id
          handle
          country: field(key: "country") { value }  
          file: field(key: "company_logo") { value }  
         reference{
             ... on MediaImage {
            image {
              url
            }
          }
         } 
      }
  }
}


Load 3 more related questions


Show fewer related questions

0



Leave a Reply

Your email address will not be published. Required fields are marked *