Replies: 11 comments 24 replies
|
Hello, I encountered some problems. It seems that Result does not support the new omit feature for the time being: |
|
The typings when using If I do Typescript still autocompletes Also can it be possible to add omit via a client extension? I dont want to add for all my clients, which is the only way currently unless i setup a new PrismaClient with its own connection. |
|
I might have found a bug with the global omit feature. Specifying a single model generates the correct types with the omitted field gone: Specifying multiple models generates incorrect types with all fields included: |
|
I am using "prisma":"5.19.1 and I can confirm that doesn't work at all. Is there any specific version that this works ? |
|
We are using the new omitApi in our project to global omit the password from the user. THX! |
|
omitApi doesn't work for me... I run |
|
Feature request: would be amazing if it would be possible to globally omit computed fields. We would like to do some expensive computing in custom fields that is rarely accessed in the app. |
|
I am using 5.19.1 and it works, thank you |
|
I have a problem with global omit in my Next.js project. Let's say I omit the password from the user model like this: const prisma = new PrismaClient({
omit: {
user: {
password: true,
},
},
});Then I have a route /user/update/[id] and in the server component page.tsx i get the user and send it to a Form component: const Page = async ({ params }: Props) => {
const { id } = await params;
const user = await prisma.user.findUnique({
where: {
id: id
}.
});
return <Form user={user} />
}So the Form component is something like this: import { type User } from "@prisma/client";
export default function Form({ user }: {user: User}) {
....
}The problem is that the type User from @prisma/client still has the password field so there is a type mismatch:
I would expect the type User from @prisma/client to be updated so as to not include the password. |






Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Support for excluding fields from Prisma Client query results via
omitis in preview behind theomitApipreview feature since release of 5.13.0 on April 23rd:Please share your feedback about this new functionality in this discussion.
All reactions