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).

GraphQL Compose: Preview

650 sites Security covered Drupal 10–11 Graphql ecosystem
View on drupal.org

This module extends Drupal's preview functionality for use with GraphQL Compose. It allows you to control who can access preview entities through permissions and enables tokenized URLs for previews, which can be queried directly or embedded in your frontend.

A module for extending the permissions of Drupal's preview functionality, to be used with GraphQL Compose.

TL;DR

  • Works with GraphQL Compose
  • Enable module.
  • Add permissions.
  • Query data with tokens.

Permissions

  • Go to /admin/people/permissions and search for GraphQL Compose: Preview
  • Enable the View preview entities permission for each role that can use tokenised preview links.

GraphQL Query

This module introduces the preview query, which takes an optional token argument, which returns a NodeUnion type.

{
  preview(id: "da02328a-b605-421e-8077-f2ff344c5d49", token: "ABC123FB9dsOKU") {
    ... on NodePage {
      title
      status
    }
  }
}

Route Query

This module allows tokenised preview URLs.

Example:

  • Edit a node, click Preview
  • URL is a uuid path: /node/preview/da02328a-b605-421e-8077-f2ff344c5d49/full
  • Add the unique token to that URL: /node/preview/da02328a-b605-421e-8077-f2ff344c5d49/full?token=ABC123FB9dsOKU

You'll now have full access to that preview.

This can be used in conjunction with GraphQL Compose's route query:

route(path: "/node/preview/da02328a-b605-421e-8077-f2ff344c5d49/full?token=ABC123FB9dsOKU") {
  ... on RouteInternal {
    entity {
      ... on NodePage {
        title
        status
      }
    }
  }
}

Embedded field on preview display

This module also introduces a preview_token field formatter to the Drupal node UI, which can be used to add a preview display to your interface.

This can render a tokenised link to the preview route, and an iframe formatter to embed your frontend app.

How you ultimately implement this is up to your frontend application.

Example:

  • Go to /admin/structure/types/manage/page/display
  • Drag Preview with Token to the top of the list.
  • Configure the formatter to your liking.
  • Optionally set the ENV GRAPHQL_COMPOSE_PREVIEW_URL to set the URL for the preview links.

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
4
Tracked since
Apr 2025
Latest release
10 months ago
Releases (12 mo)
1 ▼ from 3
Maintenance
Slowing

Release Timeline

Releases

Version Type Core Release date
2.0.0-alpha1 Pre-release 10–11 Oct 15, 2025
2.x-dev Dev 10–11 Aug 20, 2025
1.1.1 Stable 10–11 Jul 14, 2025
1.1.0 Stable 10–11 Apr 27, 2025