[ADVANCED] Prisma Extensions - dynamic typing
I'm trying to create a $allModels extension with proper typing and have been struggling.
This is what I was able to cobble together:
There are a few issues I want to resolve here:
1) There has to be some better typing for the ctx (or accessing the parent model).
2) I want to have an includes parameter, and return dynamic typing much like a regular .findFirst query. How can I achieve this? The only thing I can think of is that undefined Result generic which i can't seem to figure out what it does.
Thanks
1 Reply
Practically speaking, lets say I have
I want to be able to call prisma.a.findOrCreate({ data:{name:'hi'}, includes:{ b:true } })
solved 2)