Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

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.

Depends on

Dependencies of the latest stable release

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Jul 2025
Latest release
7 months ago
Releases (12 mo)
1
Maintenance
Active

Releases

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