Skip to content

Injecting middleware and/or permissions #30

Discussion options

You must be logged in to vote

Hey @kristinlindquist , thank you for using this library.

Custom rules can be defined easily as described on the tRPC Shield README.

Also, since Prisma tRPC Shield Generator and any Prisma generator in general aim to always be consistent with the Prisma schema, this means the generated files will always be overwritten.

Now, as for defining custom rules through generation, this currently isn't supported.

Maybe we can read comments from the Prisma schema. But as you know the schema does not mention the CRUD operations; just the models and the fields.

So, the other way might be to 1st generate the default object, then pass it as an option to the generator again after the user has modified it…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kristinlindquist
Comment options

Answer selected by kristinlindquist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants