=== (optional) Question context ===
I believe that Gatsby is not completing the exports.sourceNodes() lifecycle function (in my custom plugin) before attempting the createPages() lifecycle function - it then fails because those graphQL nodes are not yet in the schema (due to asynchronity). However the GQL nodes are available in graphiQL and work fine.
THe gatsby develop command also provides this warning:
warning The gatsby-source-lambda plugin has generated no Gatsby nodes. Do you need it?
again, these nodes are definitely queriable in graphiQL or if I settimeout 5000 on the createPages() function.
=== Question ===
How can I ensure that a custom plugins exports.sourceNodes() function completes before the main gatsby-node.js createPages() function is called?
I am using async/await on the sourceNodes() everywhere (even forEach loops).
Note: This question relates to another question I have asked here (note: they are the same problem, but different questions): Gatsby: Cannot query field <FIELD> on type "Query" - an async mystery?
on Gatsby ^3.0.1
https://stackoverflow.com/questions/66837847/how-to-prevent-gatsby-develop-from-running-a-custom-plugins-exports-sourcenodes March 28, 2021 at 10:19AM
没有评论:
发表评论