Patch Changes
-
fix: normalize field set selection sets (#3162)
FieldSet
scalar represents a selection set without outer braces. This means that users could potentially specify some selections that could be normalized (i.e. eliminate duplicate field selections, hoist/collapse unnecessary inline fragments, etc). Previously we were using@requires
field set selection AS-IS for edge conditions. With this change we will now normalize theFieldSet
selections before using them as fetch node conditions. -
Fixed missing referenced variables in the
variableUsages
field of fetch operations (#3166)Query variables used in fetch operation should be listed in the
variableUsages
field. However, there was a bug where variables referenced by query-level directives could be missing in the field. -
Fix fragment generation recursion logic to apply minification on all subselections. (#3158)
-
Fixed a bug that
__typename
with applied directives gets lost in fetch operations. (#3164)The sibling typename optimization used by query planner simplifies operations by folding
__typename
selections into their sibling selections. However, that optimization does not account for directives or aliases. The bug was applying the optimization even if the__typename
has directives on it, which caused the selection to lose its directives. Now,__typename
with directives (or aliases) are excluded from the optimization.