feat(gatsby-source-wordpress): process multiple manifest ids on a preview action #32723
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Initially I thought building the manifest ID on the Gatsby side would be enough. Then I noticed if a preview build fails and then is triggered again but the user is still sitting on the preview loader they will be waiting for a manifest id that will never exist even though the preview might still succeed. So in gatsbyjs/wp-gatsby#180 I'm storing manifest ID's on each preview action in WP so that they can be queried in
gatsby-source-wordpress
and each can be processed.This makes WP preview more stable with the upcoming preview loader.
To prevent making a breaking change and needing to release v6 of
gatsby-source-wordpress
due to requiring a new minimum remote version of WPGatsby I added a new helper to check if a field name exists on a type in the remote schema so that the new code will only run if WPGatsby supports this feature. So the WPGatsby PR above can only be merged once Cloud loader is released but this PR can be merged/released anytime.