Skip to content

feat: add generateOnlyEnums option to typescript #3718

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

Closed
wants to merge 2 commits into from
Closed

feat: add generateOnlyEnums option to typescript #3718

wants to merge 2 commits into from

Conversation

c0m1t
Copy link
Contributor

@c0m1t c0m1t commented Mar 25, 2020

generateOnlyEnums was added to typescript plugin options.
This allows typescript plugin to generate only enums.

Our team use relay package. relay-compiler generates Query, Mutation and fragment types based on schema.graphql file. So other types this library generates are not useful to us, except enums.

The problem is whenever we have a type that uses an enum it generates that type again, I mean there could be definition of an enum in 20 different files. We always liked to have a single source of truth for enums. We even wrote a small package relay-enum-generator. So we would really appreciate it if there were an option in your package to make this possible. I suppose other teams using relay probably have this issue.

@dotansimha
Copy link
Owner

Thank you @c0m1t !
We recently merged this: #3760 this also does that, and generates only enums ;)

@dotansimha dotansimha closed this Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants