-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
fix(gatsby-source-wordpress): Add steps for refetch_ALL
#33264
fix(gatsby-source-wordpress): Add steps for refetch_ALL
#33264
Conversation
`REFETCH_ALL` action_type implemented on WPGatsby was not being handled. This takes care of that by adding a conditional for `REFETCH_ALL`, sources the Node and checks if the sourceNode has `refetchAll` boolean set in addition to other Or conditionals. To add `refetchAll` GatsbyTypes was modified to add the new property.
refetch_ALL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one change, otherwise this looks great!
@@ -60,6 +61,9 @@ export const handleWpActions = async api => { | |||
break | |||
case `NON_NODE_ROOT_FIELDS`: | |||
await fetchAndCreateNonNodeRootFields() | |||
case `REFETCH_ALL`: | |||
helpers.refetchAll = true; | |||
await sourceNodes(helpers, {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay here! I was out on vacation and had a lot of things to catch up on when I got back. Can we refactor this to not mutate helpers
?
await sourceNodes({ ...helpers, refetchAll: true }, {})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TylerBarnes - Thank you for getting back and no worries! Just made the change you requested and commited.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks and works great :D thanks for this!! Looks like there are some linting issues but I'll use the Gatsby bot to fix that. Thanks again!
…y into psharma-fix-refetch-all
Looks like the failling tests are unrelated so I'm going to merge this. Thanks again for this awesome contribution! 🎉 |
@TylerBarnes - Happy to help, thanks for your help as well! |
…3264) Co-authored-by: Tyler Barnes <tylerdbarnes@gmail.com>
Co-authored-by: Tyler Barnes <tylerdbarnes@gmail.com>
Description
REFETCH_ALL
action_type implemented on WPGatsby was not being handled. This takes care of that by adding a conditional forREFETCH_ALL
, sources the Node and checks if the sourceNode hasrefetchAll
boolean set in addition to other Or conditionals. To addrefetchAll
GatsbyTypes was modified to add the new property.Documentation
Where is this feature or API documented?
@gatsbyjs/documentation - Not sure where this is documented?
Related Issues
Link to the issue that is fixed by this PR (if there is one)
e.g. Fixes #33260
@TylerBarnes - Here's the change we talked about, I had to slightly change how I am calling sourceNodes method.