Skip to content

Commit

Permalink
Merge pull request #666 from angeloashmore/master
Browse files Browse the repository at this point in the history
fix: await resolver function
  • Loading branch information
maticzav authored Feb 8, 2020
2 parents a030b61 + 5bf1d43 commit db4eb55
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function generateFieldMiddlewareFromRule(
const res = await rule.resolve(parent, args, ctx, info, options)

if (res === true) {
return resolve(parent, args, ctx, info)
return await resolve(parent, args, ctx, info)
} else if (res === false) {
return options.fallbackError
} else {
Expand Down
2 changes: 1 addition & 1 deletion tests/fallback.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('fallbackError correctly handles errors', () => {
`
const resolvers = {
Query: {
test: () => {
test: async () => {
throw new Error()
},
},
Expand Down

0 comments on commit db4eb55

Please sign in to comment.