Gatsby's createNodeId is deterministic  📥 💡

Let's start with a definition:

In computer science, a deterministic algorithm is an algorithm that, given a particular input, will always produce the same output[...] Wikipedia

In our Gatsby Source YouTube oEmbed Plugin, I did not trust this to be true. Complicating the code by caching the connection between the YouTube Id and the generated node id as part of the How to use the Gatsby Cache to skip subsequent external API calls

But I had this inkling it would make sense for it is deterministic and made sure to check with Ward when he guested last week's unauthorized and rum-fueled treasure hunt.

Then this week, I came over a source plugin in the wild that does not make use of createNodeId's deterministic nature, prompting me to share this information with you and update the Gatsby Source YouTube oEmbed Plugin.

Did you know?
Do you care?

 
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!