using prisma $extends to add fields to a model, whats the best practice for TS?
Below is how i add a custom "client" field to my tokens model - but now my Token model doesn't really match since there is no client field in that. What is the best practice for taking care of that?
5 Replies
anyone know the proper way of doing this?
You should be able to get the client property on the type returned by a query.
Operating against partial structures of your model types | Prisma D...
This page documents various scenarios for using the generated types from the Prisma namespace
well, the way i'm doing/asking this, i'm doing an $extend, so i want it in
Token
. it will always be Token
. I'm not just doing a query with an includeThat’s what I am saying. You can redefine the types that are generated by Prisma; however, it is possible to extract the types from the Prisma client, and use those instead.