Skip to content

Commit

Permalink
Avoid voiding result.data just because diff.result incomplete.
Browse files Browse the repository at this point in the history
This change fixes issue #8620, by not clobbering `result.data` whenever
`diff.complete` is false, but introduces other problems (test failures)
that I will solve in later commits.
  • Loading branch information
benjamn committed Aug 12, 2021
1 parent bd03ff0 commit 1b1f085
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/core/ObservableQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,12 @@ export class ObservableQuery<
if (!this.queryManager.transform(this.options.query).hasForcedResolvers) {
const diff = this.queryInfo.getDiff();

result.data = (
diff.complete ||
this.options.returnPartialData
) ? diff.result : void 0;
if (diff.complete || this.options.returnPartialData) {
result.data = diff.result;
}
if (equal(result.data, {})) {
result.data = void 0 as any;
}

if (diff.complete) {
// If the diff is complete, and we're using a FetchPolicy that
Expand Down

0 comments on commit 1b1f085

Please sign in to comment.