Dynamic resolvers with Decorators in Entity #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I had time to brood about the previously mentioned idea in the PR #6 and i ended trying a possible solution. Although i think that it would be preferable to be implemented by type-graphql itself.
Like in the others PR i sent, i just had time to put the query working and didn't worried with mutation and its parameters.
And like before i will feign to not have seen the innumerable ts-ignore spread all over the place...
The way it work is similar to the prototype code given in #6
Import the general functions for the resolvers and add them as a parameter to @autoQueries in entity.
See the example in src\entity\Tomato.ts
Seem to works as it is, but mutations need more work. And also, it may break if used with more than one entity :(
Just a proof of concept or something in those lines.
p.s. Sorry. just saw that i should have cleaned the git history
Ok Done the squash