graphql-modules-preset doesn't obey enumsAsTypes and doesn't generate per-module Resolvers types for enum internal values #6023
Labels
core
Related to codegen core/cli
kind/question
Improvements or additions to documentation
stage/0-issue-prerequisites
Needs more information before we can start working on it
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.The text was updated successfully, but these errors were encountered: