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): bug patch for issue 35460 #35817
Conversation
…e.MediaItem.exclude` is `true` during updates
packages/gatsby-source-wordpress/src/steps/source-nodes/update-nodes/wp-actions/update.js
Outdated
Show resolved
Hide resolved
…-nodes/wp-actions/update.js Co-authored-by: Tyler Barnes <tylerdbarnes@gmail.com>
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 good! Thanks for this @tsdexter !
no problem @TylerBarnes ... happy to be able to contribute ps. I noticed there are a few other places where |
Good to know, thanks for calling that out! Always open to a PR for those ;) but otherwise I'll make a note to remember to add those checks. Thanks again! |
@TylerBarnes would it make sense to localize the check into the function? If so, I can do that and cleanup the other individual checks. Something like: export default async function fetchReferencedMediaItemsAndCreateNodes({
referencedMediaItemNodeIds,
mediaItemUrls,
}) {
const state = store.getState()
const queryInfo = state.remoteSchema.nodeQueries.mediaItems
const { helpers, pluginOptions } = state.gatsbyApi
if (pluginOptions.type.MediaItem.exclude) return []
const { createContentDigest, actions } = helpers
const { url } = pluginOptions
const { typeInfo, settings, selectionSet, builtFragments } = queryInfo
... |
Yeah, that seems reasonable 👍 |
Description
Check the
pluginOptions.type.MediaItem.exclude
before fetching referenced media items during page updatesDocumentation
Related Issues
Fixes #35460