Skip to content

Commit d39265f

Browse files
authored
docs(migrating-from-v2-to-v3): correct getNode snippet (#34542)
1 parent bb85cef commit d39265f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/docs/reference/release-notes/migrating-from-v2-to-v3.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -755,8 +755,8 @@ exports.sourceNodes = ({ actions, getNodesByType }) => {
755755
In case you only have an ID at hand (e.g. getting it from cache or as `__NODE`), you can use the `getNode()` API:
756756
757757
```js:title=gatsby-node.js
758-
exports.sourceNodes = async ({ actions, getNodesByType, cache }) => {
759-
const { touchNode, getNode } = actions
758+
exports.sourceNodes = async ({ actions, getNode, getNodesByType, cache }) => {
759+
const { touchNode } = actions
760760
const myNodeId = await cache.get("some-key")
761761
762762
touchNode(getNode(myNodeId))

0 commit comments

Comments
 (0)