paljs / prisma-tools

Prisma tools to help you generate CRUD system for GraphQL servers
https://paljs.com
MIT License
687 stars 55 forks source link

Incorrect generated sdl type Enums @paljs/cli@3.3.5 #214

Closed dundich closed 3 years ago

dundich commented 3 years ago

schema.prisma

model User {
  id          String    @id @default(uuid())
  role        UserRole? @default(USER)
}

enum UserRole {
  SYSADMIN
  ADMIN
  USER
}

after pal g for mode sdl generated ... resolversTypes.ts with incorrect type Client.Prisma.UserRole

export interface User {
  [key: string]: Resolver<any, any, any>
  id?: Resolver<Client.User, {}, string>
  role?: Resolver<Client.User, {}, Client.Prisma.UserRole | null> 
        ===> !!!   Namespace '".../node_modules/.prisma/client/index".Prisma' has no exported member 'UserRole'

But after fixed type...

  role?: Resolver<Client.User, {}, Client.UserRole | null>   - is OK

PS. typo Client.Prisma.UserRole -> Client.UserRole

AhmedElywa commented 3 years ago

@dundich thank your for report the issue