From fe8a21a3682ea5bffb3ff5120bf59f88ad738fa2 Mon Sep 17 00:00:00 2001 From: Kurt Tomlinson Date: Fri, 26 Jun 2020 20:38:47 -0400 Subject: [PATCH 1/2] show where getNodesByType comes from --- docs/docs/creating-a-source-plugin.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/creating-a-source-plugin.md b/docs/docs/creating-a-source-plugin.md index ffff109d76463..92e7642122bdd 100644 --- a/docs/docs/creating-a-source-plugin.md +++ b/docs/docs/creating-a-source-plugin.md @@ -432,7 +432,7 @@ If possible, the proactive listener approach creates the best experience if exis The code to support this behavior looks like this: ```javascript:title=source-plugin/gatsby-node.js -exports.sourceNodes = async ({ actions }, pluginOptions) => { +exports.sourceNodes = async ({ actions, getNodesByType }, pluginOptions) => { const { createNode, touchNode, deleteNode } = actions // highlight-start From e1bcd58868ed24c2379bab32b5cdb31819284eb9 Mon Sep 17 00:00:00 2001 From: Kurt Tomlinson Date: Mon, 20 Jul 2020 21:37:06 -0400 Subject: [PATCH 2/2] indicate the code is an example per PR feedback Co-authored-by: Marcy Sutton --- docs/docs/creating-a-source-plugin.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/creating-a-source-plugin.md b/docs/docs/creating-a-source-plugin.md index 92e7642122bdd..0ce21a9a8945e 100644 --- a/docs/docs/creating-a-source-plugin.md +++ b/docs/docs/creating-a-source-plugin.md @@ -429,7 +429,7 @@ One challenge when developing locally is that a developer might make modificatio If possible, the proactive listener approach creates the best experience if existing APIs in the data source can support it (or you have access to build support into the data source). -The code to support this behavior looks like this: +Here's some pseudo code that shows this behavior: ```javascript:title=source-plugin/gatsby-node.js exports.sourceNodes = async ({ actions, getNodesByType }, pluginOptions) => {