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: Added missing fulfilledFragments to generated initializers #3067

Merged
merged 4 commits into from
Jun 12, 2023

Conversation

AnthonyMDev
Copy link
Contributor

@AnthonyMDev AnthonyMDev commented Jun 8, 2023

Fixes #2989

The generated initializers were missing the fulfilled fragments in certain cases. When you were merging in selection sets from a named fragment, we only were including the root of that fragment. This was missing the nested type cases of that fragment, and was just completely wrong if you were actually merging from a nested entity field on that named fragment.

This now uses the merged sources to calculate all of the selection sets that would be fulfilled from the fragment root to the merged source.

@netlify
Copy link

netlify bot commented Jun 8, 2023

Deploy Preview for apollo-ios-docs canceled.

Name Link
🔨 Latest commit 070e27c
🔍 Latest deploy log https://app.netlify.com/sites/apollo-ios-docs/deploys/648263f59c12220007463d9a

var next = selectionSet.scopePath.last.value.scopePath.head
while next.next != nil {
defer { next = next.next.unsafelyUnwrapped }
var currentNode = Optional(selectionSet.scopePath.last.value.scopePath.head)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like the renaming here from just using next

Copy link
Member

@BobaFetters BobaFetters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, nice work!

@AnthonyMDev AnthonyMDev merged commit f64927c into main Jun 12, 2023
@AnthonyMDev AnthonyMDev deleted the fix-2989 branch June 12, 2023 18:04
This was referenced Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken codegen for nested fragments with enum
2 participants