Cannot fetch the metafield info for the MediaImage

When I use the metafieldsSet mutation graphQL API to create a new metafield to the MediaImage resource, the result is success and the metafield is created.

And then I tried to get the MediaImage and metafield info, there’s no metafields under the MediaImage, is it a bug?

This is the query for fetching the product image:

Hi @Simon_Liang,

It looks like you are requesting metafields from the preview image not the image you created the metafield on. If you move the metafields request up a level it should work.

Something like:

query {
  node(id:"gid://shopify/MediaImage/30888677212358") {
    ... on MediaImage {
      shopifyUrl
      metafields(first:10){
        nodes {
          namespace
          key
          value
        }
      }
    }
  }
  product(id:"gid://shopify/Product/7871455363270") {
    title
    media(first:10) {
      nodes {
        id
        ... on MediaImage {
          metafields(first:10) {
            nodes {
              namespace
              key
              value
            }
          }          
        }
      }
    }
  }
}

Thanks @JesseV. It helps me.