Skip to content

graphql-modules-preset doesn't obey enumsAsTypes and doesn't generate per-module Resolvers types for enum internal values #6023

Open
@darkbasic

Description

@darkbasic

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreRelated to codegen core/clikind/questionImprovements or additions to documentationstage/0-issue-prerequisitesNeeds more information before we can start working on it

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions