Open affanshahid opened 5 months ago
I have fairly complicated type with a bunch of relations that I want looked up for all of its queries. It is a hassle to copy-paste all the with() calls everywhere so I decided to build a function that wraps adding the with() calls:
with()
fn relations<'a, T>(mut q: T) -> T where T: WithQuery< 'a, RawType = submission::Data, Types = submission::Types, ReturnValue = submission::Data, >, { q.add_with( submission::dynamic_quiz_stage_data::fetch().with( prisma::dynamic_quiz_stage_data::stage_data::fetch() .with(prisma::stage_data::pipeline_assignment::fetch()), ), ); q }
However this doesn't work with find_many() since the RawType for that is Vec<Data> instead of Data. Any ideas?
find_many()
RawType
Vec<Data>
Data
I can't use include! here since my code base relies heavily on custom traits implemented on the internal Datas for different types
include!
I have fairly complicated type with a bunch of relations that I want looked up for all of its queries. It is a hassle to copy-paste all the
with()
calls everywhere so I decided to build a function that wraps adding thewith()
calls:However this doesn't work with
find_many()
since theRawType
for that isVec<Data>
instead ofData
. Any ideas?I can't use
include!
here since my code base relies heavily on custom traits implemented on the internalData
s for different types