-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more field decorator options inside the prisma schema #21
Comments
Duplicate of #11 🔒 |
Actually, it's not a duplicate 😅 #11 refers to crud resolvers methods, however fields or relations also might need to set up authorization or other custom decorators. Reopening to implement the same enhance map pattern but for model fields, as well as for input types (class-validator validation?) 😉 |
First iteration done in Next release will focus on enhancing other output types and gonna allow to put decorators on the class itself, not only on its fields. |
Second iteration is also done in const modelsEnhanceMap: ModelsEnhanceMap = {
Director: {
class: [Extensions({ isDirector: true })],
fields: {
movies: [Authorized()],
},
},
};
applyModelsEnhanceMap(modelsEnhanceMap); Third iteration will allow to decorate other object types like the aggregate ones. |
Are there any plans for a |
|
Quick update - we now have support for adding decorators to:
The last part to do is adding decorators to relation resolvers 👀 |
awesome!!! 💯 |
Relation resolvers support has been added in 0dcc0f9, so closing this one 🔒 |
It would be awesome to have a bit more control over how the CRUD resolvers are generated. For example there could be more options to the field decorator to include authorization like so:
Is this something you consider as a feature? I think this would greatly increase development speed.
The text was updated successfully, but these errors were encountered: