Using Prisma plug-in to automatically add all fields #362
Replies: 2 comments 1 reply
-
This is not something that currently exists, it may something I add through a new plugin in the future. One of the core concepts behind pothos is to create a separating between your data and your public schema, so that your API is not tied directly the your database. I may add something to support automatically creating object from your schema in the future, but my priority was to initially create something that was more flexible and decoupled. I've got some work in progress an a plugin that will add more automatic type generation in #348 but it won't be ready for a while. |
Beta Was this translation helpful? Give feedback.
-
Thx for your feedback and I understand the rationale for the separation, which is general a good practice I fully agree. Just to give you some background, my use case is that I have Sqlite database from which I generate a static website using Nextjs. |
Beta Was this translation helpful? Give feedback.
-
Would it be be possible to create an object type from a Prisma model with aal fields added automatically without specifying them all by hand?
Oc it would be nice to be able to override certain fields or exclude them (like a password field in an User object).
Ps I'm only interested in queries not mutations.
Beta Was this translation helpful? Give feedback.
All reactions