You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately with current limitations of TS (trpc/trpc#2150, microsoft/TypeScript#1213), it's impossible to correct infer return type if you are using select or include
trpc.article.findMany.useQuery(select: {id: true}})// return type is still Article not {id: number}
so, I want to explicit exclude select and include from input arguments
Unfortunately with current limitation of Zod (#79, #41) it's impossible to do something like this
@oceandrama Thanks for the suggestion. I wasn't aware that this does not work as expected.
In the latest version you can now opt out of the features by adding addIncludeType = false and addSelectType = false to the generator config. See docs.
I just removed the fields from the [Model]ArgTypeSchemas but the include and select schemas are still generated (if you have some use for it??)
@chrishoermann Wow, blazing fast! Thanks a lot, it works perfectly! I think it maybe usefull to save include and select schemas, but now I'm not using it
First of all, thanks for your project!
I'm using this package with trpc to generate inputs of procedures, like this
Unfortunately with current limitations of TS (trpc/trpc#2150, microsoft/TypeScript#1213), it's impossible to correct infer return type if you are using
select
orinclude
so, I want to explicit exclude
select
andinclude
from input argumentsUnfortunately with current limitation of Zod (#79, #41) it's impossible to do something like this
so maybe you can extends settings like https://github.com/omar-dulaimi/prisma-zod-generator has (
isGenerateSelect
andisGenerateInclude
) to omit this fields from schemas. Are there another solutions?The text was updated successfully, but these errors were encountered: