-
-
Notifications
You must be signed in to change notification settings - Fork 677
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
@Root should support returnTypeFunction
#889
Comments
I have a working fork that implements this. Let me know if you are interested in a pull request. |
Root is not visible or reflected in the schema. It's just the object you return from resolvers (queries and mutations). Hence there's completely no need to provide info which won't be used anywhere 😝 You can put whatever type you need as a type of
Now I wonder what do you do with those type info 😅 |
@MichalLytek The problem is |
You mean all the types are erased? So how the decorators works at all in your setup? Please refer to #55 to get more details how to configure babel, webpack and other tools. |
Decorators and type metadata are two separate things. |
@proteriax TypeGraphQL is designed to work with TypeScript. JS support is not official and you need some workaround and plugins to make it work, as stated in #55.
The root type info is used to create an instance of the object type class. |
I’m confused. You first said
but also
So does |
|
Is your feature request related to a problem? Please describe.
I’m using esbuild with
type-graphql
so I need to annotate types explicitly. Most decorators allow the pattern of providing a class factory such as() => [Recipe]
in caseemitDecoratorMetadata
doesn’t emit enough information, but not@Root
.Describe the solution you’d like
@Root(() => Recipe)
should be supported.Describe alternatives you’ve considered
Manually importing
__metadata
fromtslib
and annotate the type with a decorator myself.Additional context
N/A
The text was updated successfully, but these errors were encountered: