-
Notifications
You must be signed in to change notification settings - Fork 360
Schema with multiple enum generates unusable data class #1114
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
Labels
type: bug
Something isn't working
Comments
dariuszkuc
pushed a commit
to dariuszkuc/graphql-kotlin
that referenced
this issue
Apr 8, 2021
We are providing default `__UNKNOWN_VALUE` value for enums. When generating references to this default value using kotlinpoet `MemberName` it was adding redundant explicit import of that enum value. If there were multiple fields asking for different enums then compilation would fail with multiple imports of `__UNKNOWN_VALUE`. Updated logic to use the explicit `TypeName` of the enum and `Name` of the constant. Resolves: ExpediaGroup#1114
smyrick
pushed a commit
that referenced
this issue
Apr 14, 2021
We are providing default `__UNKNOWN_VALUE` value for enums. When generating references to this default value using kotlinpoet `MemberName` it was adding redundant explicit import of that enum value. If there were multiple fields asking for different enums then compilation would fail with multiple imports of `__UNKNOWN_VALUE`. Updated logic to use the explicit `TypeName` of the enum and `Name` of the constant. Resolves: #1114
huehnerlady
pushed a commit
to huehnerlady/graphql-kotlin
that referenced
this issue
Apr 27, 2021
We are providing default `__UNKNOWN_VALUE` value for enums. When generating references to this default value using kotlinpoet `MemberName` it was adding redundant explicit import of that enum value. If there were multiple fields asking for different enums then compilation would fail with multiple imports of `__UNKNOWN_VALUE`. Updated logic to use the explicit `TypeName` of the enum and `Name` of the constant. Resolves: ExpediaGroup#1114
dariuszkuc
added a commit
to dariuszkuc/graphql-kotlin
that referenced
this issue
Aug 5, 2022
We are providing default `__UNKNOWN_VALUE` value for enums. When generating references to this default value using kotlinpoet `MemberName` it was adding redundant explicit import of that enum value. If there were multiple fields asking for different enums then compilation would fail with multiple imports of `__UNKNOWN_VALUE`. Updated logic to use the explicit `TypeName` of the enum and `Name` of the constant. Resolves: ExpediaGroup#1114
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Library Version
What version are you using?
4.0.0-rc1
Describe the bug

When I have a schema that contains multiple enums, then the client generates a class that does not work (due to ambiguity). If I comment out one of the enum imports it compiles fine.
To Reproduce
Steps to reproduce the behavior. Please provide:
Kotlin code to generate schema:
Similar to this as I'm referencing local schema.graphql and query.graphql #1104
Schema
Query
Expected behavior
A working data class, for example:
The text was updated successfully, but these errors were encountered: