diff --git a/src/core/masking.ts b/src/core/masking.ts index fcfe71c06b9..d28dc0c4ffa 100644 --- a/src/core/masking.ts +++ b/src/core/masking.ts @@ -156,17 +156,13 @@ function maskSelectionSet( __DEV__ ? `${path || ""}.${keyName}` : void 0 ); - // This check prevents cases where masked fields may accidentally be - // returned as part of this object when the fragment also selects - // additional fields from the same child selection. if ( - !childChanged && + childChanged || + // This check prevents cases where masked fields may accidentally be + // returned as part of this object when the fragment also selects + // additional fields from the same child selection. Object.keys(masked).length !== Object.keys(data[keyName]).length ) { - childChanged = true; - } - - if (childChanged) { memo[keyName] = masked; changed = true; }