The createNode
API, one of the Gatsby Node APIs, is responsible for creating nodes, which can take the form of any object. Within Redux, which Gatsby leverages to manage state, nodes are stored under the nodes
namespace. The nodes
namespace carries state in the form of a map of Node
identifiers to Node
objects.
Node creation happens first and foremost in the sourceNodes
bootstrap stage, and all nodes created during sourceNodes
execution are top-level nodes that lack a parent. To indicate this, source plugins set each node’s parent
field to null
.
NOTE
For more information about node tracking, which Gatsby uses to track relationships between a node’s object values (i.e., not children) and its identifier, consult the documentation.
Leave a Reply