dotansimha / dotansimha/graphql-code-generator
If enumValues and enumsAsTypes is set, codegen should emit export type
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 1.4k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 23
Description
If we set both `enumValues` and `enumsAsTypes`:
```yml
schema: src/schema.json
overwrite: true
generates:
src/graphql-types.ts:
config:
enumsAsTypes: true
enumValues: ./graphql-enums
plugins:
- typescript
```
It will emit exports in the generated file:
```ts
export { CarStatus };
export { ReservationStatus };
// ...
```
Emitting exports is fine, however because these are just types, they will break **babel**. Instead, it needs to be:
```ts
export type { CarStatus };
export type { ReservationStatus };
// ...
```
This should be controlled by `enumsAsTypes` option which is completely logical, even though the enums are not generated by [graphql-code-generator](https://github.com/dotansimha/graphql-code-generator)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.