This module automatically exposes a configurable GraphQL schema based on your
entity types and fields.

Read the full documentation on how to use this module.

What is implemented

The base schema included generates a GraphQL schema based on the entity types and fields you select. It provides some sane interfaces like Entity or Url

Included extensions

These features are available as extensions and can be enabled if needed.

Schema Extension Description
Breadcrumb Adds types and fields to get the breadcrumb for a route.
Debugging Adds fields useful during development.
Entity Query Implements the entityById and entityQuery fields.
Field Config Adds support to get information about Drupal fields (like name, description or isTranslatable).
Formatted Date Get formatted dates from date/timestamp fields.
Image Render derivatives, e.g. image styles.
Language Switch Links Get language switch links for a route.
Local Tasks Get the local task links for a route.
Media Additional helper fields for dealing with media entities.
Menu Load menus incl. links and child links.
Render Field Item Adds viewField and viewFieldItem fields to get the rendered markup of any field.
Reverse Entity Reference Adds reverseReferences fields to do reverse entity reference lookups.
Routing Adds a route query field to load a URL from a string.
Taxonomy Additional fields for dealing with taxonomy terms (e.g. children).
User Adds a query field to get the current user and additional fields on the User type to check for permissions or roles.
User Login Adds mutations to handle user login, logout or password reset.
Views Adds a query field to execute a view and return the resulting entities.

Included submodules

Module Project Link Description
graphql_messenger_schema Adds a messengerMessages query field to fetch all Drupal
messenger messages collected during resolving.
graphql_environment_indicator
environment_indicator
Fields to get name and color of the active environment.
graphql_metatag_schema metatag Types and fields to get metatags for routes and entities.
graphql_masquerade_schema masquerade Adds a masqueradeContext query field and a
masqueradeSwitchBack mutation.
graphql_rokka_schema rokka Support for the rokka.io image service.
graphql_tablefield_schema tablefield Adds a field to FieldItemTypeTablefield with the structured
table data.
graphql_telephone telephone Adds a field to FieldItemTypeTelephone with the parsed
phone number with the possibility to get formatted numbers.

Differences to graphql_compose

This module does something similar like GraphQL Compose but the codebase is different. Under the hood we rely on helpers of "webonyx/graphql-php" and the generated schema is very close to what we had in GraphQL's graphql_core in V3. This module is in particular helpful if you want to transition from GraphQL 3.0 to 4.0.

  • We use the API from webonyx/graphql-php to generate the schema
  • The base schema strictily follows Drupal's entity and field system.
  • It is fully configurable. You can choose to expose your entity and fields using the configuration UI.
  • The module scales even with large GraphQL schemas

Installation and configuration

Hint

  • Disable the development mode of the GraphQL 4 module if you are not actively
    developing the schema. You will get a huge performance gain because the
    schema and the schema extensions will be cached.
  • If you find a bug or have a valuable contribution, please open an issue and
    create a patch / open a merge request. Contributions are very welcome.
Supporting organizations: 
Funding

Project information

Releases