Skip to content

Commit

Permalink
docs(migrating-from-v2-to-v3): correct getNode snippet (#34542)
Browse files Browse the repository at this point in the history
  • Loading branch information
homearanya committed Jan 19, 2022
1 parent bb85cef commit d39265f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/docs/reference/release-notes/migrating-from-v2-to-v3.md
Expand Up @@ -755,8 +755,8 @@ exports.sourceNodes = ({ actions, getNodesByType }) => {
In case you only have an ID at hand (e.g. getting it from cache or as `__NODE`), you can use the `getNode()` API:
```js:title=gatsby-node.js
exports.sourceNodes = async ({ actions, getNodesByType, cache }) => {
const { touchNode, getNode } = actions
exports.sourceNodes = async ({ actions, getNode, getNodesByType, cache }) => {
const { touchNode } = actions
const myNodeId = await cache.get("some-key")
touchNode(getNode(myNodeId))
Expand Down

0 comments on commit d39265f

Please sign in to comment.