type-safely wrapping `findMany`
I am trying to wrap the
Can someone help me to get this right:
So my trail of thought was to make it similar to a client extension (which is not what I want. I would like the function presented to be correctly typed) yet I do not have the
So I get this error if I use
As a 2nd problem, I can't get the return type right. the
So apparently I get everything wrong and I can't figure out how this should work. Does anyone know how to make it so that my personal wrapper exactly type-safely mirrors the type/shape/behavior of
findMany function in a separate function.Can someone help me to get this right:
So my trail of thought was to make it similar to a client extension (which is not what I want. I would like the function presented to be correctly typed) yet I do not have the
this property to work with. So I ended using Prisma.Args to describe the shape of input args that I want and Prisma.Exact to narrow A down to Prisma.Args<T, 'findMany'>. This leads to args being rejected as valid for prisma.assignment.findManySo I get this error if I use
Prisma.Exact for argsAs a 2nd problem, I can't get the return type right. the
return prisma.assignment... statement has red squiqqly lines with TS complaining:So apparently I get everything wrong and I can't figure out how this should work. Does anyone know how to make it so that my personal wrapper exactly type-safely mirrors the type/shape/behavior of
prisma.assignment.findMany?