create new deferred grouped field set records lazily #3998
Closed
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.
Before #3984, we could not do this because of problems with empty defers. Now, it's a safe optimization.
Consider:
Before the current change, when
alwaysThrowsthrows, the deferred grouped field set forsomeFieldwould be found to be in the "blast radius", and deferred fragmentWillBeEmptywould be filtered. This would yield:{ "data": { "alwaysThrows": null, }, "errors": [ ... ] }Prior to #3984, if we had made the current change and created the deferred grouped field set for
someFieldlazily,someFieldwould not be found to be in the "blast radius" -- because it would not have been created yet -- andWillBeEmptywould not have been filtered.However, with #3984,
WillBeEmptyis not sent because all empty deferred fragments are never sent and do not require filtering. This is now a safe change.