`UpdateMany` unchecked types are unnecessarily exposed
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 47.6k
- Forks
- 2.5k
- Avg merge
- 21h 59m
- Merged PRs (30d)
- 95
Description
Bug description
Before 4.16.0, if an update many unchecked type for a specific model was the same as the checked type, only the checked type would be exposed. We've recently changed that behavior, which can result in the exposure of a load of types that are unnecessary and that bloats the client types index file.
How to reproduce
- Use this schema
model User {
id Int @id
firstName String
lastName String
age Int
}
-
Run
prisma generate -
Notice how UpdateMany unchecked inputs are strictly the same as their checked forms.
Expected behavior
Unchecked types should only be exposed if they add more fields than their checked forms.
Prisma Version
Reproducible on Prisma 5.0.0, but also on Prisma 4.16.0 with extendedWhereUnique enabled.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No implementation file or test is named. Reproduce the issue with the provided schema using prisma generate, then trace UpdateMany input generation; done means unchecked types are exposed only when they add fields beyond their checked forms.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- databases, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100