MichalLytek / typegraphql-prisma

Prisma generator to emit TypeGraphQL types and CRUD resolvers from your Prisma schema
https://prisma.typegraphql.com
MIT License
887 stars 113 forks source link

SchemaWhereInput type incorrect for id fields (emitIdAsIDType = true) #461

Open FezVrasta opened 2 months ago

FezVrasta commented 2 months ago

Describe the Bug I have the emitIdAsIDType option enabled, but when I have a schema like the following, the generated <Schema>WhereInput type types id as StringFilter rather than treating it as ID.

schema User {
  id  String  @id @default(uuid())
}

CleanShot 2024-08-09 at 9  44 06@2x

The same happens for WhereUniqueInput

CleanShot 2024-08-09 at 9  49 51@2x

This means I have to pass ids as String from my GraphQL queries.

To Reproduce

Generate the schema I provided above.

Expected Behavior

The filter should allow me to send ID types, not String.

Environment (please complete the following information):

Additional Context