Skip to content

fix(gatsby-source-drupal): process included nodes on preview and incremental builds #28653

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pmelab
Copy link

@pmelab pmelab commented Dec 16, 2020

Description

This PR addresses two issues:

  1. When multiple nodes are updated at the same time via the preview or fastbuild updates, references to newly created content can get lost, depending on the order in the payload.
  2. Fields that are marked as included within Drupal (with JSON:API Extras) are passed, but not processed by Gatsby in the preview or fastbuild updates.

Solution

I adapted handleWebhookUpdate to accept multiple nodes at once and process the references between them correctly to solve issue #1. Then I added included content from the json payload to the list of nodes to be processed on preview or fastbuild update.

handleWebhookUpdate has to process all nodes at once to ensure proper references
between them
pass `included` nodes to `handleWebhookUpdate` and remove the loop to process
all nodes at once. else, references among updated or added nodes are potentially
not resolved correctly
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Dec 16, 2020
@LekoArts LekoArts added topic: source-drupal Related to Gatsby's integration with Drupal and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Dec 17, 2020
@smthomas smthomas self-assigned this Dec 18, 2020
@smurrayatwork
Copy link
Contributor

@pmelab This PR has conflicts, FYI.

@LekoArts LekoArts added the topic: source-plugins Relates to the Gatsby source plugins (e.g. -filesystem) label Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: source-drupal Related to Gatsby's integration with Drupal topic: source-plugins Relates to the Gatsby source plugins (e.g. -filesystem)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants