Skip to content

Commit

Permalink
Always treat patches returning a different result
Browse files Browse the repository at this point in the history
Even though the actual data might look the same (i.e. the patched data
is null)
  • Loading branch information
clarencenpy committed Jul 18, 2018
1 parent c8abadc commit 0eb55e0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/apollo-client/src/core/QueryManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,15 @@ export class QueryManager<TStore> {
lastResult.data === resultFromStore.data
);

if (isDifferentResult || previouslyHadError) {
if (
isDifferentResult ||
previouslyHadError ||
resultFromStore.loadingState
) {
// If loadingState is present, this is a patch from a deferred
// query, and we should always treat it as a different result
// even though the actual data might be the same (i.e. the patch's
// data could be null.
try {
observer.next(maybeDeepFreeze(resultFromStore));
} catch (e) {
Expand Down

0 comments on commit 0eb55e0

Please sign in to comment.