Skip to content

Commit

Permalink
fix(cache): fix optional chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
robertu7 committed Oct 23, 2020
1 parent 881ec72 commit 33e0d08
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ const typeResolver = (type: string, result: any) => {
}

const idResolver = (type: string, result: any) => {
if (type === NODE_TYPES.article && result.articleId) {
if (type === NODE_TYPES.article && result?.articleId) {
return result.articleId
}

return result.id
return result?.id
}

const schema = makeExecutableSchema({
Expand Down

0 comments on commit 33e0d08

Please sign in to comment.