Skip to content

[client] support selection of multiple enums #1115

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

Merged
merged 1 commit into from
Apr 14, 2021

Conversation

dariuszkuc
Copy link
Collaborator

📝 Description

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.

🔗 Related Issues

Resolves: #1114

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 dariuszkuc added type: bug Something isn't working changes: patch Changes require a patch version module: client Issue affects the client code labels Apr 8, 2021
@smyrick smyrick merged commit e49327c into ExpediaGroup:master Apr 14, 2021
@dariuszkuc dariuszkuc deleted the generate_multiple_enums branch April 20, 2021 19:01
huehnerlady pushed a commit to huehnerlady/graphql-kotlin that referenced this pull request 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 pull request 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
Labels
changes: patch Changes require a patch version module: client Issue affects the client code type: bug Something isn't working
Development

Successfully merging this pull request may close these issues.

Schema with multiple enum generates unusable data class
2 participants