Add View title to GraphQL Compose query results

Created on 4 August 2025, 27 days ago

Problem/Motivation

Currently, the GraphQL Compose module does not include the title of the View in the result set when querying a view using the provided GraphQL schema. In some use cases, such as decoupled applications, the view title is dynamically set and must be accessible to the frontend.

Steps to reproduce

  1. Create a view with a custom title (either statically or programmatically).
  2. Enable exposure of the view in GraphQL Compose.
  3. Query the view via GraphQL Compose.
  4. Observe that the title property is missing in the GraphQL result.

Proposed resolution

Enhance the GraphQL Compose view output by adding the View title in the GraphQL result structure. For example:

{
  "view": {
    "title": "Custom View Title",
    "results": [...]
  }
}

This could be implemented via a result transformer or by extending the view query normalization logic.

Remaining tasks

  • Agree on output structure for title.
  • Patch the result transformer to inject the title.
  • Write/update tests if necessary.

User interface changes

None.

API changes

Adds a title property to the GraphQL response for view queries.

Data model changes

None.

✹ Feature request
Status

Active

Version

2.3

Component

Code

Created by

🇚🇎Colombia codimpes

Live updates comments and jobs are added and updated live.
  • views

    Involves, uses, or integrates with views. In Drupal 8 core, use the “VDC” tag instead.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024