Skip to content
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

SPIKE: Can users edit files and still re-run codegen when their schemas change? #27

Open
jgadling opened this issue May 13, 2024 · 0 comments
Assignees

Comments

@jgadling
Copy link
Contributor

jgadling commented May 13, 2024

Right now platformics exclusively supports basic CRUD actions. This is ok for a narrow set of applications, but most users will probably need to add some business logic to their endpoints. How can we support this as well as making sure users can still run make codegen when their schemas change? This might be a set of short/medium/long term plans, along the lines of:

Short term:
Support a ### USER CODE BELOW tag in the files that get written by codegen, that codegen knows not to overwrite

Medium term:
Support plugin hooks in our generated code, to allow users to add additional logic to GQL resolvers that read/write data.

There are a lot of different methods of allowing the generated Platformics code to be extended. Some examples:

  • PropelORM generates a parent class (with interesting generated code) and stub child classes for each type it supports that allow framework users to modify the stub child classes ref here
  • Could we support plugins in the codegen process as well? For example, if we enabled a 'search' codegen plugin, the generated code could update search indexes when DB data gets updated.
  • go ent does this nicely -- https://entgo.io/
@j-x-han j-x-han self-assigned this Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants