-
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
not all nodes available in sourceNodes
within gatsby-node.js
#11033
Comments
Transformer nodes won't be done necessarily by the time your code is called. You should use onCreateNode to extend nodes. |
the issue is I'm trying to map nodes to each other, but I assume its possible that during onCreateNode the related nodes I'm looking for might not have been created yet? I'm working off the example here: #3129 (comment) |
I'm also running into this issue. Trying to map two markdown files together, but it's a toss up whether Gatsby will 'see' both. Most often Gatsby only loads one of the nodes and I get null/undefined errors. And unless I'm misunderstanding the docs, Would love to see a more straightforward API that allows mapping markdown files! |
To get a deterministic order, can you partition your I have a scenario in To ensure ordering, I partitioned the configuration of the source plugin like this: plugins: [
'gatsby-plugin-react-helmet',
{
resolve: `gatsby-source-filesystem`,
options: {
name: 'img',
path: `${__dirname}/src/pages/img/`
}
},
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/src/pages`,
name: 'pages',
ignore: ['**/img/**'],
},
},
] This will tag each node with the It seems like nodes get fed through to the I'm not sure whether the |
As an aside, I've been trying to achieve a two-pass process so that I can use intermediate node query results to enrich other nodes - see #11092 |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open! Thanks for being a part of the Gatsby community! 💪💜 |
Is there no official way to bind data two ways? :'( |
Hey again! It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m Thanks again for being part of the Gatsby community! |
Description
I'm getting markdown files from my file system and creating nodes. I'd like to do work on these nodes after they are all created and read that this is possible via
sourceNodes
withingatsby-node.js
. The problem I'm running into is one set of my markdown files don't seem to be available at this step. I do see them in graphiql, but if I run a log duringsourceNodes
some of my nodes are not there.The docs say:
If you define this hook in gatsby-node.js it will be called exactly once after all of your source plugins have finished creating nodes.
Steps to reproduce
gatsby-source-filesystem
pluginsgatsby-transformer-remark
gatsby-node.js
:Expected result
The count for File nodes should match the count for MarkdownRemark nodes.
Actual result
The File node count is higher than MarkdownRemark
Environment
The text was updated successfully, but these errors were encountered: