GraphQL Compose returns Image Styles using variations based on each style.
With Responsive Image styles, these could return rendered styles, similar to graphql_responsive_image.
Enable responsive_image. Query Responsive Image attributes.
Add computed attributes similar to variations, but for Responsive Styles (like narrow, wide).
ResponsiveImage (style: wide)
ResponsiveImageStructured(style: wide)
This could return structured and rendered outputs:
"ResponsiveImage": " <img srcset=\"/sites/default/files/styles/max_325x325/public/2023-09/Hero%20Carousel.png?itok=qegoFqsi 325w, /sites/default/files/styles/max_650x650/public/2023-09/Hero%20Carousel.png?itok=Avde_2jI 650w, /sites/default/files/styles/max_1300x1300/public/2023-09/Hero%20Carousel.png?itok=a7MXZLv_ 1300w, /sites/default/files/styles/max_2600x2600/public/2023-09/Hero%20Carousel.png?itok=D6PcosLJ 1512w\" sizes=\"(min-width: 1290px) 1290px, (min-width: 900px) 650px, (max-width: 559px) 325px, 100vw\" width=\"650\" height=\"361\" src=\"/sites/default/files/styles/max_325x325/public/2023-09/Hero%20Carousel.png?itok=qegoFqsi\" alt=\"Lady with Dog\" />\n\n"
"ResponsiveImageStructured": {
"image": {
"url": "/sites/default/files/styles/max_325x325/public/2023-09/Hero%20Carousel.png",
"alt": "Lady with Dog",
"title": "",
"width": 325,
"height": 181
},
"sources": [
{
"srcset": "/sites/default/files/styles/max_325x325/public/2023-09/Hero%20Carousel.png?itok=qegoFqsi 325w, /sites/default/files/styles/max_650x650/public/2023-09/Hero%20Carousel.png?itok=Avde_2jI 650w, /sites/default/files/styles/max_1300x1300/public/2023-09/Hero%20Carousel.png?itok=a7MXZLv_ 1300w, /sites/default/files/styles/max_2600x2600/public/2023-09/Hero%20Carousel.png?itok=D6PcosLJ 1512w",
"media": "",
"type": "image/png"
}
]
}
Active
2.2
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.