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

Cleanup for #3581 - gateway over-merging unions #3616

Merged
merged 2 commits into from Jan 2, 2020

Conversation

trevor-scheer
Copy link
Member

This commit cleans up and simplifies the approach taken by #3581 to prevent the gateway from over-merging fields of unioned types.

The correct information and groupings were already present in the affected code, they just needed to be utilized correctly. Specifically, the internal for loop yielding fieldsForParentType was not being used - the less specifically grouped fieldsForResponseName was.

This commit cleans up and simplifies the approach taken by #3581
to prevent the gateway from over-merging fields of unioned types.

The correct information and groupings were already present in the
affected code, they just needed to be utilized correctly. Specifically,
the internal for loop yielding `fieldsForParentType` was not being
used - the less specifically grouped `fieldsForResponseName` was.

Co-authored-by: Tejas Shikhare <tshikhare@netflix.com>
@trevor-scheer
Copy link
Member Author

@stejas after revisiting your comment, I see what you mean and agree with your suggestion - apologies this took me so long to get around to.

I've opened this PR with co-authorship attributed to you in the commit, however if you'd like to update your (current PR)[https://github.com//pull/3457] and land that instead, I'd be happy to do that!

Let me know how you'd like to go forward, and thanks again for the contributions! 😊

@trevor-scheer trevor-scheer merged commit 61e6941 into master Jan 2, 2020
@trevor-scheer trevor-scheer deleted the trevor/gateway-unions-cleanup branch January 2, 2020 21:19
@stejas
Copy link

stejas commented Jan 10, 2020

@trevor-scheer Sorry I missed this, I was on vacation and we don't use github here so I visit it infrequently. Thank you for getting the fix in.

abernix pushed a commit to apollographql/federation that referenced this pull request Sep 4, 2020
This commit cleans up and simplifies the approach taken by apollographql/apollo-server#3581
to prevent the gateway from over-merging fields of unioned types.

The correct information and groupings were already present in the
affected code, they just needed to be utilized correctly. Specifically,
the internal for loop yielding `fieldsForParentType` was not being
used - the less specifically grouped `fieldsForResponseName` was.

Co-authored-by: Tejas Shikhare <tshikhare@netflix.com>
Apollo-Orig-Commit-AS: apollographql/apollo-server@61e6941
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants