Closed Haldaug closed 1 year ago
This exact issue is happening for me as well.
Same, I just started getting this yesterday after making no changes other than the WP GraphQL upgrade to 1.14.0. Rolling back to 1.13.10 resolves the issue.
Same issue for me. Will roll back to 1.13.10
It appears to be a problem with the way source-wordpress
is caching the remote schema. Certain types are omitted by default (because they don't work in Gatsby) but those types are only being omitted on the initial build and then are included in cached builds. When they're included they then break the schema because they're not properly implementing their interfaces since those types weren't supposed to exist anyway.
I've added some logic to catch when the generated schema doesn't match the previous schema and fail the build with a helpful error and type diffs, so that this will be more obvious in the future if it happens again. I'm also fixing the issue though and I should have a PR up tomorrow or the next day
I have a PR open fixing this ☝️ and there's a canary available as gatsby-source-wordpress@7.8.0-alpha-wp-inconsistent-schema.29
for anyone who needs it asap!
I marked the PR to be back ported for Gatsby 4 & 5 but check my previous comment for anyone who needs the fix right away
I tried this, and the issue persists. On a fresh build, some nodes are missing, but if I go to Wordpress and save the content missing while I'm running gatsby development
, it appears. @TylerBarnes
@DanielRiveraHQ are you able to share a reproduction with me? Sharing it privately works too (tyler@gatsbyjs.com)
Thanks for the canary fix, worked for me!
@TylerBarnes I'm also getting this issue. Looking at getting a reproduction however I've found that the issue occurs specifically when I exclude types in my config. I've attached the config below.
{
resolve: `gatsby-source-wordpress`,
options: {
url: process.env.GATSBY_GRAPHQL_API_URL,
schema: {
timeout: 60000,
perPage: 50,
requestConcurrency: 15,
previewRequestConcurrency: 5
},
html: {
useGatsbyImage: false,
createStaticFiles: false
},
type: {
MediaItem: {
createFileNodes: false
},
UserRole: {
exclude: true
},
Comment: {
exclude: true
}
},
develop: {
hardCacheMediaFiles: true
}
}
},
If I include comments and user roles then I no longer get an issue.
@philJohnson I'll check if that solution works! 🙏
@TylerBarnes I'm also getting this issue. Looking at getting a reproduction however I've found that the issue occurs specifically when I exclude types in my config. I've attached the config below.
{ resolve: `gatsby-source-wordpress`, options: { url: process.env.GATSBY_GRAPHQL_API_URL, schema: { timeout: 60000, perPage: 50, requestConcurrency: 15, previewRequestConcurrency: 5 }, html: { useGatsbyImage: false, createStaticFiles: false }, type: { MediaItem: { createFileNodes: false }, UserRole: { exclude: true }, Comment: { exclude: true } }, develop: { hardCacheMediaFiles: true } } },
If I include comments and user roles then I no longer get an issue.
Removing type: {...}
entirely worked for me. I was only using it for excludes anyway.
I have a PR open fixing this ☝️ and there's a canary available as
gatsby-source-wordpress@7.8.0-alpha-wp-inconsistent-schema.29
for anyone who needs it asap!
I am still getting this error in 2024. Did'nt you resolved the issue?. I have upgraded my WPGraphql version and after that I am getting the error. Do we have a permanent solution?
@TylerBarnes Please help me in resolving this. I want a permanent solution rather than changing my gatsby-source-wordpress version to the specific version you mentioned above
@maghaffar I'm not maintaining this repo anymore but the fix was released in Gatsby 4 and 5 nearly a year ago
@TylerBarnes Can you please mention who is maintaining the repo. I think that the it is needed to fix this again with WPGraphql 1.24.0.
Preliminary Checks
Description
An error occurs during parallel query running after upgrading the Word Press plugin WPGraphQL to 1.14.0, failing the build. I suspect that the update included some breaking changes for gatsby-source-wordpress.
Everything works as expected after downgrading back to 1.13.1
Reproduction Link
/
Steps to Reproduce
Expected Result
A successful build
Actual Result
I get the following error:
ERROR #11321 API.NODE.EXECUTION "gatsby-node.js" threw an error while running the createPages lifecycle: Interface field WpConnectionType.nodes expected but WpEnqueuedScriptConnectionType does not provide it. Interface field WpConnectionType.nodes expected but WpEnqueuedStylesheetConnectionType does not provide it. Interface field WpConnectionType.nodes expected but WpActionMonitorActionConnectionType does not provide it. Interface field WpConnectionType.nodes expected but WpPluginConnectionType does not provide it. Interface field WpConnectionType.nodes expected but WpThemeConnectionType does not provide it.
You can find an example of a failed build here: https://www.gatsbyjs.com/dashboard/2ed6779b-2fc9-4c4f-b7db-3aac04ebbde8/sites/cef43953-59d5-4aa4-862b-7a8d057182ef/builds/697abd16-42d4-46d8-a1a3-d80b30d3471d/details?returnTo=%2Fdashboard%2F2ed6779b-2fc9-4c4f-b7db-3aac04ebbde8%2Fsites%2Fcef43953-59d5-4aa4-862b-7a8d057182ef%2FcmsPreview#rawLogs
Environment
Config Flags
No response