queen.raae.codes · a developer’s logbook
1 min read

When to (and not to) create Gatsby Content Nodes?

Written in 2022, 4 years ago. Tools and advice may have moved on since.

With Gatsby v4 came a much strickter approach to node creation. You must only create nodes in sourceNodes and onCreateNode.

Never in a resolver or anywhere else, even though I stumble over Gatsby Docs pointing in that direction every now and then.

And remember, if you create a node in onCreateNode make sure to add a parent, or it will be gone on subsequent builds using the Gatsby Cache.

 
All the best,
Queen Raae

Join the crew!

All the shenanigans from me and my piratical family, straight to your inbox.

Search the log

↑↓ to move · Enter to open · Esc to close All entries →