Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

This module allows you to output responsive Drupal images via GraphQL. It provides field types that can return either structured image data or the complete HTML markup for a responsive image, with the image style selectable in your GraphQL query.

Overview

GraphQL Responsive Image is an extension of the GraphQL module drupal/graphql 3.0 which adds the possibility to render responsive drupal images using GraphQL.
This module provides a field plugin ResponsiveImage which contains the HTML markup of a rendered responsive image and a field plugin ResponsiveImageStructured that provides a structured response of image and srcsets. The responsive image style can be defined as an option in the GraphQL Query.

Usage

Expand your Media Image in your GraphQL query with the field ResponsiveImage or ResponsiveImageStructured, under style select the desired responsive image style.

query ($node: String!) {
  nodeById(id: $node) {
    ... on NodeContentPage {
      fieldHero {
        entity {
          ... on MediaImage {
            fieldMediaImage {
              ResponsiveImageStructured(style: IMAGESTYLE)
              ResponsiveImage(style: IMAGESTYLE)
            }
          }
        }
      }
    }
  }
}

ResponsiveImageStructured(style: IMAGESTYLE)

Gives you the Responsive Image as structured data back.

Usage (dumping the response object):
{{ dump(graphql.nodeById.fieldYOURIMAGEFIELD.entity.fieldMediaImage.ResponsiveImageStructured) }}.

ResponsiveImage(style: IMAGESTYLE)

Gives you the rendered entity of the Responsive Image back.
If you are using Twig, you can render the responsive image like this

Usage:
{{ graphql.nodeById.fieldYOURIMAGEFIELD.entity.fieldMediaImage.ResponsiveImage | raw }}
Note: This renders the repsonsive image with the according Responsive Image Drupal Template. It will use the Template from the theme if you override the template in your frontend theme.

Activity

Total releases
2
First release
Jul 2025
Latest release
6 months ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Active

Releases

Version Type Release date
8.x-1.6 Stable Jan 9, 2026
8.x-1.5 Stable Jul 23, 2025