Skip to content

Magento 2 Graphql Additional Product Image Values

Good afternoon all,

I am currently working with a custom frontend for Magento 2 that uses Graphql to grab product data:

Currently for the product image section we are getting back the following data attributes:

media_gallery {
   url
   position
   label
}

Is there a way that I can request any image roles that are associated with the images in the product gallery? The query would then be something like the following:

media_gallery {
   url
   position
   label
   role
}

I know this will require M2 backend module and any guidance on how to do this would be very welcome.