Type-graphql: Adding instructions for Typescript/Babel 7 setup

Created on 4 Apr 2019  路  3Comments  路  Source: MichalLytek/type-graphql

Currently this framework does not work with Babel 7 and @babel/preset-typescript setup, the reasons are:
1- Parameter decorators is not supported by @babel/plugin-proposal-decorators
2- Babel strips type information thus Reflect.getMetadata() returns undefined, more explanation url

After spending few hours to come to this conclusion i solved these issues by installing this babel plugin babel-plugin-transform-typescript-metadata url

I liked this framework and i almost gave up on it because of these issues,
It will be good to include this in the installation guide, to make it easy for developers with Babel 7 and @babel/preset-typescript setup which is a common setup.

Thanks

Community Documentation Help Wanted

Most helpful comment

All 3 comments

With #296 TypeGraphQL will turn more toward TypeScript compiler, so you will miss a lot new goodness by sticking to babel.

And feel free to create a PR with a new doc page in Others section with info how to setup Typescript/Babel correctly, maybe even with an example in the repository.

Great work on #296
Since i am not using babel heavily on backend projects it will be reasonable to switch to Typescript compiler.

Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

laukaichung picture laukaichung  路  3Comments

Janushan picture Janushan  路  3Comments

limenutt picture limenutt  路  3Comments

tongtwist picture tongtwist  路  3Comments

robertchung97 picture robertchung97  路  3Comments