README
Gatsby app connected to Drupal GraphQL v3 via gatsby-graphql-source-toolkit
☝️ Overview and local setup instructions: silverback.netlify.app/drupal/gatsby (alt)
The app is set up with Amazee Gatsby Starter.
Entry points
- createQueryExecutor prepares the GraphQL query executor for either Gatsby Site or Gatsby Preview mode.
- drupalNodes keeps the meta information about the content we want to fetch from Drupal.
- On Drupal side this should match to Gatsby::SUPPORTED_ENTITIES_BUNDLES.
- Important: While Tags taxonomy terms aren't used on they own in our Gatsby app, we still need to fetch them all in order to allow the toolkit to discover and resolve relationships between the node types in the schema.
- createSourcingConfig tells to the toolkit how to work with Drupal's GraphQL.
- api-fragments tells to the toolkit which content fields to fetch from Drupal's GraphQL.
- fetchNodeChanges fetches the content updates from Drupal and tells to the toolkit what to (re)fetch or delete.
sourceNodes
from gatsby-node.ts combines all the above.
Less important
- createPaginationAdapter tells to the toolkit how to paginate Drupal's GraphQL queries.
Tests
See test.sh and cypress/integration.
How Drupal is informed about the Preview Refresh status
See gatsby-plugin-is-refreshing.