Skip to content

Fix: Added missing fulfilledFragments to generated initializers#3067

Merged
AnthonyMDev merged 4 commits intomainfrom
fix-2989
Jun 12, 2023
Merged

Fix: Added missing fulfilledFragments to generated initializers#3067
AnthonyMDev merged 4 commits intomainfrom
fix-2989

Conversation

@AnthonyMDev
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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