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

Support complex values for enums #13

Open
jmoseley opened this issue Aug 1, 2017 · 1 comment
Open

Support complex values for enums #13

jmoseley opened this issue Aug 1, 2017 · 1 comment

Comments

@jmoseley
Copy link

jmoseley commented Aug 1, 2017

The following code will produce invalid GQL:

interface Foo {
  export enum FooEnums {
    ONE = <any>'ONE',
    TWO = <any>'TWO',
    THREE = <any>'THREE',
  }

  export enum BarEnums {
    ONE = FooEnums.ONE,
    TWO = FooEnums.TWO,
  }
}

The GQL produced will be something like:

enum FooEnums {
  ONE
  TWO
}

enum BarEnums {
  FooEnums.ONE
  FooEnums.TWO
}

This is invalid. The code generation should produce the expected:

enum FooEnums {
  ONE
  TWO
}

enum BarEnums {
  ONE
  TWO
}
@nevir
Copy link
Contributor

nevir commented Aug 1, 2017

Yeah, I think there's a more general problem here where we should be extracting the value for each enum entry, not the name of it

@jmoseley jmoseley changed the title Support nested enums Support complex values for enums Aug 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants