Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On-save integrity validation based on GraphQL schema #1404

Open
pmelab opened this issue Aug 25, 2023 · 0 comments
Open

On-save integrity validation based on GraphQL schema #1404

pmelab opened this issue Aug 25, 2023 · 0 comments
Labels
drupal Concerns Drupal backends.

Comments

@pmelab
Copy link
Contributor

pmelab commented Aug 25, 2023

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.

@pmelab pmelab added the drupal Concerns Drupal backends. label Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
drupal Concerns Drupal backends.
Projects
None yet
Development

No branches or pull requests

1 participant