Gatsby app connected to Drupal GraphQL v3 via gatsby-graphql-source-toolkit
The app is set up with Amazee Gatsby Starter.
- 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.
sourceNodesfrom gatsby-node.ts combines all the above.
- createPaginationAdapter tells to the toolkit how to paginate Drupal's GraphQL queries.