You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @vjpr, if I'm correct the typegraphql plugin is currently checking for a limited field of usage, like supporting promises and arrays, as seen here.
The Reflect.metadata output is here, and it seems to me that the typegraphql:info is a simple object literal with some info. It should not be hard to implement it in the plugin, and maybe I can find some time in the next weeks to add support (surely behind a flag).
However, I cannot find a spec in order to understand the desired output. The code seems to do the following:
Promises unwrapping (Promise<T> is treated as T)
Arrays unwrapping
Unions are processed but only as T | null (i.e. T | U is not supported)
These things may be implemented, but since this is a POC I'd like to have more info from the awesome job made by @19majkel94, since I'm worried do proceed without a clean plan ahead. Do you have any info / plans / specs available? I was not able to find them in the repo
I am going to create a TypeGraphQL-specific plugin and in the feature I might turn it into an universal reflection plugin with described specs that can be implemented e.g. by a babel plugin.
But the very future step might be not possible in current babel typescript pipeline as I would like to provide support for raw TS constructs like interfaces, without constraints to classes and decorators only.
type-graphql is a popular TS library for GraphQL. They plan on writing a TS compiler extension to DRY up type info in field definitions.
MichalLytek/type-graphql#296
How hard would it be to support this? Do you have time? Could you provide some pointers on the difficulties and where to begin?
The text was updated successfully, but these errors were encountered: