Closed
Description
Describe the bug
While using the client-preset
and configuration option enumsAsTypes
the generation ignores the config option and outputs enums.
Your Example Website or App
https://codesandbox.io/s/frosty-fire-0jf3rk
Steps to Reproduce the Bug or Issue
- Go to https://codesandbox.io/s/frosty-fire-0jf3rk
- Run
yarn generate
- Open
types/graphql.ts
- See
Role
enum
Expected behavior
enumsAsTypes
should be taken into account in generation and Role
enum should be export Role = 'ADMIN' | 'USER'
Screenshots or Videos
No response
Platform
- OS: all
- NodeJS: v14, v16
graphql
version: 16.6.0@graphql-codegen/cli
: 2.13.6@graphql-codegen/client-preset
: 1.0.6
Codegen Config File
schema: schema.graphql
documents: document.graphql
generates:
types:
preset: client
config:
enumsAsTypes: true
Additional context
I'll open a pull request which fixes the issue.