Help with Prisma Validator static evaluation
I am trying to build a helper function that will allow me to abstract away some deeply nested includes for a data type. However I'm trying to make this reusable like in the following snippet
The issue with this is that I wish it would correctly map when passing
true
to { include: { someTable: true } }
. Any wizards that could help?2 Replies
I am not sure I follow, could you elaborate?
Sure. The issue I'm having is that if I use the helper as shown above in a query I get partial types, because it maps to
I'd like it to, for example:
and have the result be
Table & {someTable: ItsType}
when I pass true, it currently returns Table & {someTable?: ItsType}