Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
refactor: Selection set generation for
@defer
#3176refactor: Selection set generation for
@defer
#3176Changes from all commits
e2809cb
4f071d7
e63a4da
3ca6c2b
945e3b7
d9738e7
24e9294
91b6f7e
9bc1413
0f9c8a8
135b2f5
6238588
4d217ca
e4ebcd8
123c3f0
f933c1e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes also should really be tested in tests on the
RootFieldBuilder
, not just theSelectionSetTemplateTests
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in https://github.com/apollographql/apollo-ios/pull/3176/files#diff-75a0a416f524d6139314ef8b30651767a446ba7f6a1dbc0e00a4c64f130251d1R2232.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking we should also be adding tests for this behavior to the IR building tests, not just the
SelectionSetTemplateTests
. Making sure the actual IR is structured properly is important and having those tests makes it a LOT easier to debug and figure out the cause of bugs than just the template tests.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AnthonyMDev - needing your feedback here whether this is the best way to be determining at an operation-level whether any fragments are deferred; I think it should be since we're only doing direct selections.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this code should be valid, but I'm wondering if we could prevent another iteration through the entire selection set here.
What if we added
hasDeferredFragments
to theRootFieldBuilder.Result
. We could keep track of this as avar
on theRootFieldBuilder
, and while building, if we encounter a deferred fragment, we just set that totrue
.