Replies: 2 comments 6 replies
-
This is definitely something I want to add. It would probably be a new plugin (maybe I can't give you a timeline on when I would have time to build it, but I would be more than happy to help if its something you wanted to start working on. It's probably fairly high on my list of things to build next, but I can't make any guarantees about when it might be ready. |
Beta Was this translation helpful? Give feedback.
-
Hey, started a discussion to get feedback on an early implementation of this here: #544 |
Beta Was this translation helpful? Give feedback.
-
How do you write where and order by input objects for your Prisma backed GraphQL schema?
Currently, I manually define the types like this:
This can be quite cumbersome, so I thought it might be great if there were helper methods:
Both methods would generate the filters and SortOrder enum the first time they are used.
What do you think about that? It would eliminate a lot of repetitive work and would make writing those input objects type safe.
One issue I have with my current manual approach is that types for
args.where
andargs.orderBy
are incorrect. Take the following query:The problem is that
where
andorderBy
aretype | null | undefined
, but prisma expectstype | undefined
(not only the root object, but also nested properties). A helper method to convert the inputs from pothos to Prisma compatibly inputs, would be great.Beta Was this translation helpful? Give feedback.
All reactions