Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Views Bootstrap 5.5.4 — Minor update available for module views_bootstrap (5.5.4). Release: Download Tracker 1.0.7 — Minor update available for module download_tracker (1.0.7). Release: Directory2Block Slideshow 1.0.8 — Minor update available for module directory2block_slideshow (1.0.8). Release: Mautic Audiences 1.1.5 — Minor update available for module mautic_audiences (1.1.5). Release: Rightup theme 1.0.3 — Minor update available for theme vartheme_bs5_rightup (1.0.3). Release: CommentOn 1.0.6 — Minor update available for module commenton (1.0.6). Release: ChatGPT Ads 1.0.3 — Minor update available for module chatgpt_ads (1.0.3). Release: Opensolr Search 5.1.3 — Minor update available for module opensolr_search (5.1.3). Module Revived: Swagger-PHP OpenAPI 3 documentation generator 1.0.0 — Module swagger_php updated after 10 months of inactivity (1.0.0). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage.

GraphQL Formatters

No security coverage

Part of the Graphql ecosystem · 29 projects

View on drupal.org

GraphQL Field Formatters and renderer helpers for fields.
Applies to GraphQL 3.x only.

Use case

When it makes sense to delegate the rendering to Drupal.

Examples:

  • delegate sanitizing to Twig instead of a Javascript library
  • delegate the rendering of complex data structures (e.g. paragraphs) to Drupal
  • in combination with GraphQL Twig
  • in a progressively decoupled setup, where markup is shared between decoupled
    / non decoupled components for styling.

For helpers like:

  • Text summary: truncate or reuse the field summary if available
  • Plain text: strip tags of formatted texts
  • Drupal date format
  • Currency
  • ...

Already supported by GraphQL 3.x core

You might not need this module for these use cases,
supported by the Drupal GraphQL core:

  • Format a date with inline format: entityCreated(format: "d/m/Y")
  • Render an entity with a view mode: entityRendered(mode: TEASER)
  • Image styles
  • ...

Dependencies

GraphQL 8.3.x

View Mode based Field Formatter

WIP, does not support all data types.

Inherits from the view mode configuration of the entity bundle.

Example:

query {
  nodeQuery {
    entities {
      ... on NodeArticle {
        fieldTextFormatted {
          viewModeFieldFormatter(mode: TEASER)
        }
      }
    }
  }
}

Settings based Field Formatter

WIP

Instead of inheriting from the view mode configuration, the
settings from the field are passed.

Example:

query {
  nodeQuery {
    entities {
      ... on NodeArticle {
        fieldTextFormatted {
          fieldFormatter(settings: {
            label: "hidden",
            trimmed: 600
          })
        }
      }
    }
  }
}

Other field based helpers

Text summary

WIP

query {
  nodeQuery {
    entities {
      ... on NodeArticle {
        fieldTextFormatted {
          textSummary(max_chars: 300)
        }
      }
    }
  }
}

Date based on the date formats (e.g. short, medium) - GraphQL Date

WIP

Currency formatter

WIP

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Aug 2023
Latest release
3 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core Release date
2.0.x-dev Dev Aug 16, 2023