Skip to content

Commit

Permalink
Add gatsby v2 as peer dependencie
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Abel committed Jul 1, 2018
1 parent b33e408 commit ae946c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,8 @@
},
"dependencies": {
"elasticlunr": "^0.9.5"
},
"peerDependencies": {
"gatsby": ">2.0.0-alpha"
}
}
2 changes: 2 additions & 0 deletions src/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const createOrGetIndex = async (node, cache, getNode, server, {

for (const pageId of node.pages) {
const pageNode = getNode(pageId);

const fieldResolvers = resolvers[pageNode.internal.type];
if (fieldResolvers) {
const doc = {
Expand Down Expand Up @@ -99,6 +100,7 @@ exports.sourceNodes = async ({ getNodes, actions }) => {
exports.onCreateNode = ({node, actions, getNode}, {
resolvers,
}) => {

if (Object.keys(resolvers).indexOf(node.internal.type) === -1) {
return;
}
Expand Down

0 comments on commit ae946c3

Please sign in to comment.