Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

On-save integrity validation based on GraphQL schema #1404

@pmelab

Description

@pmelab

Current status

A lot of Gatsby builds fail due to integrity issues between Drupal and the GraphQL schema, like ...

  • Missing entity references
  • Emtpy Gutenberg blocks
  • ... whatever else we did not think of when writing the schema

Solution

For each entity type that is referenced as @entity in the GraphQL schema, derive a FULL query (similar to the one Gatsby does during sourcing) and execute it on save against the added or modified entity. The result of the query is stored on the entity itself:

  • status: did the query succeed
  • errors: potential errors

Based on that, multiple things could happen:

  • A slack message is sent to tell us that there is content that will break the build.
  • There is a listing of all "broken" entities, along with their error messages.
  • warning for the editor that they just saved something that can't go live
  • if it fails, don't track a gatsby update for that entity

This process should also happen for all referencing entities (e.g. pages that embed an image). So, for example, if an image becomes invalid or deleted, the referencing pages get marked with an error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    drupalConcerns Drupal backends.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions