MichalLytek / MichalLytek/typegraphql-prisma

compatibility issue in generated code for prisma v5 not assignable to type

Open
#445 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug community question
Dominant language
TypeScript
Stars
918
Forks
130
PR merge metrics
No merged PRs in 30d

Description

**Describe the Bug**
compatibility issue in generated code for prisma v5
```
Type 'UserWhereUniqueInput' is not assignable to type '{ id: string; email: string; } & { id?: string | undefined; email?: string | undefined; AND?: UserWhereInput | UserWhereInput[] | undefined; OR?: UserWhereInput[] | undefined; NOT?: UserWhereInput | ... 1 more ... | undefined; password?: string | ... 1 more ... | undefined; createdAt?: string | ... 3 more ... | unde...'.
Type UserWhereUniqueInput is not assignable to type { id: string; email: string; } ...
```

**Environment (please complete the following information):**

- Node v20.11.1
- `typegraphql-prisma` last current version
- Prisma version 5

[see isssue] (https://github.com/unlight/prisma-nestjs-graphql/issues/177#issuecomment-2002730860)
at the end one solution

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the generated TypeScript types and the linked issue comment, then reproduce the incompatibility with Node v20.11.1, typegraphql-prisma, and Prisma 5. Done means the generated UserWhereUniqueInput is assignable to the expected input type without the reported TypeScript error.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, node.js, typescript
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.