-
Notifications
You must be signed in to change notification settings - Fork 11
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
Feature Request: Dry up Schema Notation #44
Comments
It looks like they are doing something similar to what I'm thinking about in this library: https://hexdocs.pm/dilute/Dilute.html#module-types |
Hey @cpursley, thanks for the suggestion! I have already thought about this in the past, but in my current implementations, there's usually a reasonable difference between the Ecto Schema and the Absinthe Objects (not exposing all database fields and adding extra custom fields that are calculated via resolvers). Therefore, I don't see the 2 schemas as code duplication, since I think it's good to have these different layers. So I think the best way to go about this problem would be to rely on generators that generate both schemas as a starting point, and then allow the developers to customize them as needed. Something similar to What do you think? |
Hi @gabrielpra1 ~ those are good points and would give you a good place to start. There might be some ideas here if you want to build gen it into Crudry: https://github.com/sashman/absinthe_gen (or just use this lib) |
This is a really great effort. The CRUD Repo and Resolver modules are really helpful. It reminds me of some of the things Hasura is trying to accomplish.
It would be also be helpful to DRY up Absinthe schema notation by pulling in the Ecto Schemas and auto-generating the Absinthe objects since the fields are often the same thing.
Any thoughts on this or ideas on how I could go about this and contribute to the project?
The text was updated successfully, but these errors were encountered: