Skip to content

Commit

Permalink
fix(graphql): findLinkedNodeByField not returning any value (gatsbyjs…
Browse files Browse the repository at this point in the history
…#11045)

<!--
  Have any questions? Check out the contributing docs at https://gatsby.app/contribute, or
  ask in this Pull Request and a Gatsby maintainer will be happy to help :)
-->

## Description
`findLinkedNodeByField` does not return anything. This PR adds the missing `return`.
<!-- Write a brief description of the changes introduced by this PR -->

## Related Issues

<!--
  Link to the issue that is fixed by this PR (if there is one)
  e.g. Fixes gatsbyjs#1234, Addresses gatsbyjs#1234, Related to gatsbyjs#1234, etc.
-->
  • Loading branch information
DanielRuf authored and gpetrioli committed Jan 22, 2019
1 parent 96ba8bd commit 8b6b5ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/gatsby/src/schema/infer-graphql-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function inferFromMapping(
}

function findLinkedNodeByField(linkedField, value) {
getNodes().find(n => n[linkedField] === value)
return getNodes().find(n => n[linkedField] === value)
}

export function findLinkedNode(value, linkedField, path) {
Expand Down

0 comments on commit 8b6b5ca

Please sign in to comment.