Skip to content

Commit

Permalink
Move check into existing conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Aug 22, 2024
1 parent 7029cfd commit f5b021a
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/core/masking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit f5b021a

Please sign in to comment.