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

fix: Improve alias handling in client generation #1763

Merged

Conversation

WIStudent
Copy link
Contributor

📝 Description

See #1760 for a description of the problem this PR tries to fix.

I first created the new test case and then worked through the code to figure out where ComplexObject was wrongly deduplicated. verifySelectionSet in generateTypeName.kt came to the conclusion, that

  first: complexObjectQuery {
    nameA: name
  }

and

  second: complexObjectQuery {
    nameB: name
  }

contain the same fields although they do not. Using selection.alias (if it exists) instead of selection.name in calculateSelectedFields fixed the issue.

🔗 Related Issues

fixes #1760

Take aliases into account when calculating the names of the selected
fields.

fixes ExpediaGroup#1760
@dariuszkuc dariuszkuc added changes: patch Changes require a patch version module: client Issue affects the client code module: plugin Issue affects the plugins code labels Apr 28, 2023
@dariuszkuc dariuszkuc merged commit 2bbc501 into ExpediaGroup:master Apr 28, 2023
@dariuszkuc
Copy link
Collaborator

Thanks for the fix!

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 module: plugin Issue affects the plugins code
Development

Successfully merging this pull request may close these issues.

[client] Aliases are not taken into account correctly when result classes are generated
2 participants