dotansimha / dotansimha/graphql-code-generator
graphql-modules-preset doesn't obey enumsAsTypes and doesn't generate per-module Resolvers types for enum internal values
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 1.4k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 23
Description
**Describe the bug**
When using the graphql-modules preset it always generates enum as TypeScript type instead of enum, even if you specify `enumsAsTypes: false` (which is the default anyway).
Also it doesn't generate per-module Resolvers types for enum internal values (it does in the complete schema types).
**To Reproduce**
This is the repro: https://github.com/darkbasic/gqlmodules-codegen-enumastypes-repro
This is the codesandbox url: https://codesandbox.io/s/github/darkbasic/gqlmodules-codegen-enumastypes-repro
About the enums Resolvers types as you can see they get generated in the complete schema types: https://github.com/darkbasic/gqlmodules-codegen-enumastypes-repro/blob/master/src/types/graphql.ts#L133
While they don't in the per-module schema types:
https://github.com/darkbasic/gqlmodules-codegen-enumastypes-repro/blob/master/src/modules/A/types/module-types.ts#L19
https://github.com/darkbasic/gqlmodules-codegen-enumastypes-repro/blob/master/src/modules/B/types/module-types.ts
Module B doesn't even have a Resolvers type because I didn't add a dummy Query to it.
About the enumsAsTypes issue just look here: https://github.com/darkbasic/gqlmodules-codegen-enumastypes-repro/blob/master/src/types/graphql.ts#L21
As you can see it clearly doesn't obey `enumsAsTypes: false`. If you comment out the graphql-modules preset it will work as expected.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.