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

Look into a build tool that can provide more reflection information for TypeScript to avoid having to have decorators to pick this up #196

Open
einari opened this issue Apr 24, 2021 · 0 comments

Comments

@einari
Copy link
Contributor

einari commented Apr 24, 2021

This would be super useful for when we automatically generate GraphQL mutations for events. Right now we have to take a JSON payload as string to be able to use these.

An idea here could also be to generate enough metadata to start applying conventions. Convention resolvers could look at structure (location on disk) in combination with information from the AST. For instance look for marker interfaces or type suffixes.

Examples of this could be commands and command handlers - something we use GraphQL for, but have to be very explicit about decorators that tell what is a resolver, InputType, Field and such. This could all be generated for us, partially through capturing enough reflection data and then resolve it at runtime - or another approach would be to use TTypeScript compiler that enables running transforms at compile time and then inserting the necessary bits such as the @Resolver() decorator in front of those classes that match the convention.

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

1 participant