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

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

Stuck on a reef in the sharky waters around the Gatsby islands?

Book a 1-on-1 Gatsby Call with Queen Raae. Friendly advice you can put into action immediately, guaranteed!

Serious about Gatsby? Sign up for emails sent every weekday to help you get the most out of Gatsby!