-
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
Support for custom attributes #4002
Comments
Thanks a lot for bringing this up. This is very interesting. I'd love to discuss this further. @michaelmitchell are you part of our Slack by any chance? This is related to prisma/specs#7 |
This comment has been minimized.
This comment has been minimized.
+1 for this :) I need to mark a field as embedded somehow, to read this info and process manually. It would be nice to be able to mark a field with any kind of attributes to be able to read it from the DMMF. It can be some "meta" field, where all non-standard attributes will go. I'm playing a bit about using Prisma 2 with MongoDB, by replacing photon binaries with simple js file which just runs queries by using official Node.js driver, and I would like to know if I need to run a separate query to different collection or just take data as is, so having such kind of metadata would be useful for me. Maybe it's not a real use case, but I expect that people will build their own tools around Prisma 2, so such kind of metadata would be useful for them as well. |
I would like custom attributes as well. I'm evaluating |
Yes I also support this as this is the base of a plugin system that could enable privacy filtering and other cool features. |
@do4gr to validate if we error or ignore custom attributes. They are not surfaced in DMMF currently. |
Privacy and security features are important features which can be supported via extensions with custom attributes. Would be great to see this added. |
Any updates on this? I really think this feature would enable so many possibilities to use the Prisma schema. Just imagine auto-generating GraphQL resolvers without worring to remove internal fields (e.g. passwords), just add a custom attribute like |
Related: #1660 |
This is also related to #3102 I put a comment that is very similar to what has been mentioned here. |
I am also interested in this topic, it makes sense to me to keep application-specific attributes close to the model definition |
Definitely need this also |
I would like the ability to add custom attributes to the model that I could use to configure my generated API. For example I would like to define certain access control rights in the same file as I define the model rather than having a duplicate elsewhere. It would also come in handy to apply other API level modifiers where appropriate such as custom function calls before write or after read.
Currently I am reading schema information from the dmmf class and using it to generate my API, Ideally I would be able to call upon custom attributes at this point to shape the filters/abstraction rather than relying on an additional external config.
Currently I pull the information in separate from a config like so but it sure would be great if I could add the additional information in the same place as the model definitions some way.
The text was updated successfully, but these errors were encountered: