ts2gql
ts2gql copied to clipboard
Support complex values for enums
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
}
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