Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@graphql-codegen/flow with useFlowExactObjects: true creates invalid javascript for enums #1634

Closed
philiiiiiipp opened this issue Apr 2, 2019 · 2 comments
Labels
plugins waiting-for-release Fixed/resolved, and waiting for the next stable release

Comments

@philiiiiiipp
Copy link

Describe the bug

To Reproduce
Steps to reproduce the behavior:

  1. My GraphQL schema:
enum Example {
  Test1
  Test2
}
  1. My codegen.yml config file:
schema: ./test.gql
generates:
  ./types.flow.js:
    plugins:
      - flow
    config:
      useFlowExactObjects: true

If you run the codegen here it will produce

/* @flow */



/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {|
  ID: string,
  String: string,
  Boolean: boolean,
  Int: number,
  Float: number,
  AWSDateTime: string,
  AWSJSON: string,
|};

export const ExampleValues = Object.freeze({|
  Test1: 'Test1', 
  Test2: 'Test2'
|});


export type Example = $Values<typeof ExampleValues>;

where ExampleValues should not contain the |.

@dotansimha
Copy link
Owner

Thanks @philiiiiiipp , fixed in: #1663

@dotansimha dotansimha added the waiting-for-release Fixed/resolved, and waiting for the next stable release label Apr 7, 2019
@dotansimha
Copy link
Owner

Fixed in 1.0.7 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugins waiting-for-release Fixed/resolved, and waiting for the next stable release
Projects
None yet
Development

No branches or pull requests

2 participants