Type-graphql: property `authChecker` is not defined in type, so I can't use authChecker.

Created on 25 Jan 2020  Â·  2Comments  Â·  Source: MichalLytek/type-graphql

I try to implement this page's authChecker in doc.

But it's code was not compiled in Typescript because property authChecker is not defined.

Error message is below.

           ^
TSError: ⨯ Unable to compile TypeScript:
src/app.module.ts:50:9 - error TS2322: Type '{ AuthChecker: AuthChecker<Context, string>; }' is not assignable to type 'BuildSchemaOptions'.
  Object literal may only specify known properties, and 'AuthChecker' does not exist in type 'BuildSchemaOptions'.

50         AuthChecker
           ~~~~~~~~~~~
/Users/hogehoge/temp/typeorm-graphql-nestjs-dataloader-starter-kit/node_modules/ts-node/src/index.ts:240
    return new TSError(diagnosticText, diagnosticCodes)
           ^

and my code is below.

import { buildSchema } from "type-graphql"

buildSchema({
  resolvers: [],
  authChecker: () => {
    return true
  }
})
  • OS: Mac
  • Node: v12.14.1
  • Package version: 0.17.4
  • TypeScript version ↓
$ yarn exec tsc -v
1.19.2
Invalid

Most helpful comment

Hello @diggymo, I'm having the same issue. What was your mistake and how did you fix it?

All 2 comments

Sorry, It's issue is my mistake.

Hello @diggymo, I'm having the same issue. What was your mistake and how did you fix it?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

laukaichung picture laukaichung  Â·  3Comments

Asim13se picture Asim13se  Â·  3Comments

MichalLytek picture MichalLytek  Â·  3Comments

robertchung97 picture robertchung97  Â·  3Comments

tongtwist picture tongtwist  Â·  3Comments