-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
Hello,
I'm trying to integrate graphql-authentication into a prisma, 'typescript' & graphql-yoga codebase. It seems pretty strait forward, however the typescript compiler is complaining about Boolean and boolean being incompatible types when comparing the User model from graphql-authentication and the User model from 'prisma'.
Any guidance, or is this a legit bug?
TSError: ⨯ Unable to compile TypeScript:
api/resolvers/Query.ts(6,14): error TS2322: Type '{ env: () => { appName: string; plaidEnv: string; plaidPublicKey: string; }; currentUser(parent: any, args: any, ctx: Context, info: any): Promise<User>; }' is not assignable to type 'Type'.
Types of property 'currentUser' are incompatible.
Type '(parent: any, args: any, ctx: Context, info: any) => Promise<User>' is not assignable to type '{ fragment: string; resolve: (parent: undefined, args: {}, ctx: Context, info: GraphQLResolveInfo) => User | Promise<User>; } | ((parent: undefined, args: {}, ctx: Context, info: GraphQLResolveInfo) => User | Promise<...>)'.
Type '(parent: any, args: any, ctx: Context, info: any) => Promise<User>' is not assignable to type '(parent: undefined, args: {}, ctx: Context, info: GraphQLResolveInfo) => User | Promise<User>'.
Type 'Promise<User>' is not assignable to type 'User | Promise<User>'.
Type 'Promise<import("/home/defrex/code/fin/node_modules/graphql-authentication/dist/Adapter").User>' is not assignable to type 'Promise<import("/home/defrex/code/fin/api/gen/prisma-client/index").User>'.
Type 'import("/home/defrex/code/fin/node_modules/graphql-authentication/dist/Adapter").User' is not assignable to type 'import("/home/defrex/code/fin/api/gen/prisma-client/index").User'.
Types of property 'inviteAccepted' are incompatible.
Type 'Boolean' is not assignable to type 'boolean'.
'boolean' is a primitive, but 'Boolean' is a wrapper object. Prefer using 'boolean' when possible.
Prisma Model
type User {
id: ID! @unique
email: String! @unique
password: String!
name: String!
inviteToken: String
inviteAccepted: Boolean! @default(value: "true")
emailConfirmed: Boolean! @default(value: "true")
emailConfirmToken: String
resetToken: String
resetExpires: DateTime
deletedAt: DateTime
lastLogin: DateTime
joinedAt: DateTime!
isSuper: Boolean! @default(value: "false")
accounts: [Account!]!
}Metadata
Metadata
Assignees
Labels
No labels