How to exclude fields from method return value based on query parameters? #23990
Labels
bug/2-confirmed
Bug has been reproduced and confirmed.
kind/bug
A reported bug.
team/client
Issue for team Client.
topic: omit
topic: omitApi
topic: typescript
Discussed in #23947
Originally posted by Cat7373 April 24, 2024
Question
My model is defined as follows:
When querying using findMany, the return value is defined as follows:
As you can see, there is no password field.
I'm trying to write a general utility method whose return value is deduced as follows:
As you can see, the password field was not successfully excluded.
Please help, how to define the parameters and return values of testQuery so that parameter exclusion can be handled correctly, thank you.
How to reproduce (optional)
No response
Expected behavior (optional)
No response
Information about Prisma Schema, Client Queries and Environment (optional)
The text was updated successfully, but these errors were encountered: