We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently graphql enums are modelled in TS using normal enums. In order to not have any runtime consequences we can switch to const enum (https://www.typescriptlang.org/docs/handbook/enums.html#const-enums)
const enum
The text was updated successfully, but these errors were encountered:
(crossposting from #1827)
Note that issues can arise when using const enums if care is not taken, even the TypeScript PM suggests that:
Sure, they can be great for the internals of a library to get some speed improvements, but they generally shouldn't be used outside of that scope.
ref: facebook/create-react-app#4837 (comment)
The TypeScript team development lead has also chimed in and said that using string unions is the best approach for this project:
From a TypeScript language perspective, this is a big improvement. 👍
ref: #1750 (review)
Also, const enums doesn't work with Babel which many people are using to transpile their TypeScript code...
ref: https://babeljs.io/docs/en/babel-plugin-transform-typescript#caveats
Sorry, something went wrong.
No branches or pull requests
Currently graphql enums are modelled in TS using normal enums. In order to not have any runtime consequences we can switch to
const enum
(https://www.typescriptlang.org/docs/handbook/enums.html#const-enums)The text was updated successfully, but these errors were encountered: