Releases: angeloashmore/gatsby-node-helpers
Releases · angeloashmore/gatsby-node-helpers
v1.0.3
v1.0.1
chore(release): 1.0.1
v1.0.0
chore(release): 1.0.0
v0.3.0
Adds support for optionally async middleware for createNodeFactory
.
const MyNodeType = createNodeFactory(
'NodeType',
await node => {
const modifiedNode = await someAsyncFunction(node)
// Do some processing
return modifiedNode
}
)
const myNode = await MyNodeType(nodeData)
// Do things with myNode if necessary
createNode(myNode)
Or if you are not able to use async
/await
:
const MyNodeType = createNodeFactory(
'NodeType',
node =>
someAsyncFunction(node)
.then(modifiedNode => {
// Do some processing
return modifiedNode
})
)
MyNodeType(nodeData)
.then(myNode => {
// Do things with myNode if necessary
createNode(myNode)
})
If your Node factory does not need async functionality, createNodeFactory
will continue to work the same as before this release.
v0.2.0
Adds camelCase
around node's type
to generateNodeId
.
pre v0.2.0
generateNodeId('shareable_link', { id: 1 }) // => 'TypePrefix__Shareable_link__1'
v0.2.0
generateNodeId('shareable_link', { id: 1 }) // => 'TypePrefix__ShareableLink__1'