diff --git a/plugins/gatsby-source-nr1-sdk/gatsby-node.js b/plugins/gatsby-source-nr1-sdk/gatsby-node.js index 7d8f762a0..a020cda4a 100644 --- a/plugins/gatsby-source-nr1-sdk/gatsby-node.js +++ b/plugins/gatsby-source-nr1-sdk/gatsby-node.js @@ -1,9 +1,27 @@ const loadSdk = require('./loadSdk'); -exports.sourceNodes = async ({ actions }, { release }) => { - // const { createNode } = actions; +exports.sourceNodes = async ( + { actions, createNodeId, createContentDigest }, + { release } +) => { + const { createNode } = actions; const sdk = await loadSdk(release); + const { Button } = sdk; - console.log(sdk); + const data = { + name: 'Button', + description: Button.__docs__.text, + }; + + createNode({ + ...data, + id: createNodeId('NR1SdkComponent-Button'), + parent: null, + children: [], + internal: { + type: 'NR1SdkComponent', + contentDigest: createContentDigest(data), + }, + }); };