Integrate graphql

Created on 8 May 2025, 28 days ago

Problem/Motivation

In a headless drupal setup using GraphQL, there is currently no way to query or expose system tags assigned to content entities.
Headless frontend often rely on tag data for filtering, display and analytics. The inability to access System Tags via GraphQL limits their usefulness in such scenarios.

Proposed resolution

This patch adds GraphQL integration for the System Tags module, exposing tags via custom DataProducer, SchemaType, and SchemaExtension plugins.
Implemented files:

  • src/Plugin/GraphQL/DataProducer/SystemTags.php
  • - Provides a systemTags DataProducer to fetch system tag values for an entity.

  • src/Plugin/GraphQL/SchemaExtension/SystemTagsSchemaExtension.php
  • - Adds the systemTags field to supported content (e.g. Node, Media, etc.) that use the System Tags field.

  • src/Plugin/GraphQLCompose/SchemaType/SystemTags.php
  • - Defines the GraphQL type used for system tags, including the tag's label and internal ID.

  • src/Plugin/GraphQLCompose/SchemaType/SystemTagsInterface.php
  • - Declares a shared interface for all entities supporting system tags, enabling reuse across types.

Feature request
Status

Active

Version

2.1

Component

Code

Created by

🇧🇪Belgium britt.vanderlinden

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @britt.vanderlinden
  • 🇧🇪Belgium lammensj

    @britt.vdl, thank you for the contribution! I do have a couple of remarks:
    - Can you open a MR using Gitlab? There are some checks in place that are being executed on that platform (think phpcs etc.)
    - Can you change the version to 3.0.x?
    - The proposed changes should be moved to a new submodule, with a dependency on grapqh. It's not my intention to make the main module dependent in it.
    - If possible, could you a kernel test?

Production build 0.71.5 2024