paljs / prisma-tools

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

@paljs/cli v2.8.2 does not generate Prisma enums in resolversTypes.ts #159

Closed ZenSoftware closed 3 years ago

ZenSoftware commented 3 years ago

In the latest release of @paljs/cli v2.8.2, there seems to be a bug whereby Prisma enums are no longer generating their equivalent Typescript types within the resolversTypes.ts output. This is causing compile issues as there are missing types.

schema.prisma

...

enum Pool {
  A
  B
}

enum Score {
  A
  B
  C
  D
}

I see in my git diff that within resolversTypes.ts, the follow lines have been removed from the output previously generated using @paljs/cli v2.6.3

export enum Pool {
  A = 'A',
  B = 'B',
}
export enum Score {
  A = 'A',
  B = 'B',
  C = 'C',
  D = 'D',
}

When compiling my app the following errors occur:

ERROR in C:/a/Work/oss/apps/api/src/app/graphql/resolversTypes.ts(1824,10):
TS2304: Cannot find name 'Pool'.
ERROR in C:/a/Work/oss/apps/api/src/app/graphql/resolversTypes.ts(1825,11):
TS2304: Cannot find name 'Score'.
Version: typescript 4.0.3
AhmedElywa commented 3 years ago

Working on that now

AhmedElywa commented 3 years ago

Can you try the last version 2.8.3?

ZenSoftware commented 3 years ago

Thanks @AhmedElywa, that fixed it. ^_^