-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Custom attributes #1660
Comments
At my company we are currently implementing a custom attribute system for the typegraphql-prisma generator as it looks like Prisma doesn't have yet a native way to extend it for generator consumers. We would like to be alienated with the Prisma team in the long run so our extension system maybe could work as a base to what could be brought back to Prisma as a native way to do it. We have currently an RFC with our proposal that we are already implementing it, but if posible we would like to get feedback from the Prisma team about it. |
In a lot of applications I have used custom attributes to do a few common things ranging from:
An example in .Net we have used is something like this [TextBox("Middle Name")]
public string MiddleName { get; set; }
[TextBox("Postal Code", GridVisible = true, GridOrder = 8, ShowInGroupBy = true)]
public string PostalCode { get; set; } I have used similar patterns in other projects where we allowed this to build up a definition of what a model looks like to the application. This allows models to be consistent across multiple UIs and the model definition contains everything the UI would need to know about how to display the model. |
I think #3102 has everything that I have asked for. |
There are a lot of use cases (e.g. #1604, https://github.com/MichalLytek/type-graphql/issues/476, graphql-nexus/nexus-plugin-prisma#584, ...) which would benefit from the Prisma schema allowing the definition of "custom attributes" which should be exposed through the Prisma SDK.
The text was updated successfully, but these errors were encountered: