prisma / prisma/orm

`UpdateMany` unchecked types are unnecessarily exposed

Open
#20,189 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug/2-confirmed kind/bug tech/engines tech/engines/query engine topic: large schema topic: performance topic: schema
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
  1. Use this schema
model User {
  id Int @id
  firstName String
  lastName String
  age Int
}
  1. Run prisma generate

  2. 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

Open the contributing guide

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.