Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Boolean' is not assignable to type 'boolean' when assigning to Prisma User #47

Open
defrex opened this issue Feb 24, 2019 · 0 comments

Comments

@defrex
Copy link

defrex commented Feb 24, 2019

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!]!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant