Closed emab closed 1 year ago
I like how this simplifies and shortens the names. Code looks good to me. Just make sure to document the new flag across the README.
Other than that, we're ready to merge
I like how this simplifies and shortens the names. Code looks good to me. Just make sure to document the new flag across the README.
Other than that, we're ready to merge
Added the flag to the table - let me know if you'd like an example with flag on / off in the README as well.
Released in https://github.com/omar-dulaimi/prisma-trpc-generator/releases/tag/1.1.0
Thank you for your contribution!
Description
This PR adds an optional boolean configuration variable for the generator called
showModelNameInProcedure
which istrue
by default.When enabled the generated output is slightly modified - instead of getting names like this:
findFirstX
deleteOneX
createOneX
The model name "X" is removed leaving only:
findFirst
deleteOne
createOne
The reason I think people may like this (I do personally) is that the tRPC router name itself provides the context of what object you're mutating or querying.
userRouter.findFirst({ where: { id: 1 } })
reads perfectly fine wherasuserRouter.findFirstUser({ where: { id: 1 } })
seems overly verbose.Interested to hear your thoughts!
References
Discussion thread:
63