Skip to content

enumsAsTypes can't be used with client-preset #8471

Closed
@panusoi

Description

@panusoi

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

  1. Go to https://codesandbox.io/s/frosty-fire-0jf3rk
  2. Run yarn generate
  3. Open types/graphql.ts
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    stage/6-releasedThe issue has been solved on a released version of the library

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions