-
Notifications
You must be signed in to change notification settings - Fork 115
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
Reduntant type info #353
Comments
First iteration done in 36113be. You can now use |
Really cool! How would I go about integrating this? I enabled the
The mentioned @ObjectType()
export class Authentication {
@Field(() => String, { nullable: true })
token: string | null;
@Field(() => Date, { nullable: true })
expiresAt: Date | null;
}
@ObjectType()
export class AdminAuthResponse {
@Field()
auth: Authentication;
@Field(() => Admin, { nullable: true })
admin: Admin | null;
}
|
@Field(() => Authentication)
auth: Authentication; |
Thanks @MichalLytek !
Would some of that duplication go away with that or is that only about the emitted code? Or is TypeScript v5 going to help with this? (microsoft/TypeScript#50820) |
I think TypeScript v5 won't solve esbuild lack of types metadata |
Currently, in some cases, the generator emits reduntant type info, like for fields of input types or models. Also, it not generates that type info for
@Args
in resolvers.The first iteration would add the
emitRedundantTypesInfo
generator option, that would generate all the missing redundant types info, so that 3rd party compilers without types metadata support would be able to work correctly with the generated code.Second iteration would invole detecting when the type info could be ommited, so that we will reduce the ammout of emitted code, that could speed up and save some space when using bundlers.
The redundancy in inputs, args and models would be disabled by default and enable full info with this option enabled.
The text was updated successfully, but these errors were encountered: