Closed qmo-harpuneetghuman closed 1 year ago
I am also facing this error. Removal of the switch case produces this issue. Although @omar-dulaimi warned me about this, I did not get any errors at that time(during integrating include and select fields). I am working on this.
Hey @Shahidul1004 Thank you for your continued support of this project. I just looked at the problem, and we actually don't need to revert your change.
We only need to remove the ".optional()" for the orderBy
field when generating the groupBy
schema.
I'll fix and release it now.
Thanks
Released in 0.7.1
Let me know if it works for you!
It works now. Thanks!
Hi @omar-dulaimi,
I am facing an issue with groupBy after the 0.7.1
release.
Since you have removed optional from orderBy, the groupBy schema always requires orderBy field. And I think that will create a problem because orderBy is only required if we use take and/or skip
in groupBy schema, otherwise, it is optional. Here is the link to the prisma doc. link
Bug description
There is an invalid type error in the case of the
groupBy
function for all the generated routers. I am building a Next.js app (with Typescript) and it fails during the build process with the following error:How to reproduce
prisma-trpc-generator
packageExpected behavior
The routers should have the correct types for the
groupBy
functions, resulting in the app being successfully built.Prisma information
Environment & setup
Prisma Version