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

SLB-202: De-duplicate Gatsby queries #126

Merged
merged 15 commits into from
Jan 18, 2024
Merged

Conversation

pmelab
Copy link
Contributor

@pmelab pmelab commented Jan 11, 2024

Description of changes

  • Introduce a new package @amazeelabs/gatsby-plugin-operations that modifies Gatsby in way
    that allows us to use the same Operation-ID's we have everywhere else. (to be moved to silverback-mono after review)
  • Unify handling of Decap- and Drupal pages (does not use @isPath any more, since its Drupal-only)
  • Refactor all Gatsby queries to use documents from @custom/schema
  • Remove the gatsby-fragments.js artefact, since its not required any more.

Motivation and context

  • De-duplicate query operations (SLB-202)
  • Full type safety in Gatsby
  • Simpler Gatsby templates and static queries
  • Full control over Gatsby page creation process
    • Allows custom queries (e.g. additional context data)
    • Less magic

How has this been tested?

  • Manually
  • Unit tests
  • Integration tests

@pmelab pmelab force-pushed the de-duplicate-gatsby-queries branch from 0148da0 to 6bce5ff Compare January 11, 2024 11:34
Required because the new "fragment inlining" behavior was added.
Plugin that allows to use persisted operations within Gatsby,
to reduce duplication and add automatic typing.
Still two GraphQL types for sourcing,
but the operations target the interface now.
@pmelab pmelab force-pushed the de-duplicate-gatsby-queries branch from 8325b68 to 5a66121 Compare January 17, 2024 09:52
@pmelab pmelab force-pushed the de-duplicate-gatsby-queries branch from 5a66121 to 148a9d5 Compare January 17, 2024 09:56
@pmelab pmelab requested a review from Leksat January 17, 2024 10:03
@pmelab pmelab self-assigned this Jan 17, 2024
@pmelab pmelab marked this pull request as ready for review January 17, 2024 10:04
Copy link
Member

@Leksat Leksat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work 💚

packages/gatsby-plugin-operations/src/graphql.ts Outdated Show resolved Hide resolved
packages/gatsby-plugin-operations/src/plugin.ts Outdated Show resolved Hide resolved
packages/gatsby-plugin-operations/tsconfig.json Outdated Show resolved Hide resolved
packages/schema/src/schema.graphql Outdated Show resolved Hide resolved
apps/website/src/pages/404.tsx Show resolved Hide resolved
apps/website/gatsby-node.mjs Show resolved Hide resolved
@pmelab pmelab merged commit 21051e2 into release Jan 18, 2024
4 checks passed
@pmelab pmelab deleted the de-duplicate-gatsby-queries branch January 18, 2024 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants