Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: Imposibility to retrieve ProductImage Metafields through ADMIN API (GraphQL)

Imposibility to retrieve ProductImage Metafields through ADMIN API (GraphQL)

atix-lbracco
Visitor
2 0 0

API; ADMIN API through GraphQL

Problem: Querying th a product with it's images and also for their metafields I don't see any of them.

I create the productImage using the REST API and it works correctly but when I query through GraphQL the product and it's images (and metafields) I don't see the already created one.

 

Did anyone solve this problem 

Replies 2 (2)

Zameer
Shopify Staff
297 31 90

Hey there,

 

Thanks for bringing this to our attention. It definitely looks to be a bug in the system, which our developers are now aware of. I'll let you know once a fix has been implemented.

 

For reference, the following GraphQL query should return a product images metafields.

 

{
  product(id: "gid://shopify/Product/#{product_id}") {
    id
    images(first: 10) {
      edges {
        node {
          metafields(first: 10) {
            edges {
              node {
                id
                key
                value
              }
            }
          }
        }
      }
    }
  }
}

To learn more visit the Shopify Help Center or the Community Blog.

Zameer
Shopify Staff
297 31 90

@atix-lbracco can you please share the X-Request-Id header for some of the GraphQL requests you are trying to make which are not returning the proper results? Thanks!

To learn more visit the Shopify Help Center or the Community Blog.