From 8e521fcded8836fc7c5806da7b9ce21015f9b6aa Mon Sep 17 00:00:00 2001 From: Sho Mukai Date: Wed, 16 Oct 2019 09:25:16 +1100 Subject: [PATCH] fix: add check for resetQueryStoreErrors in afterExecute --- packages/hooks/src/data/QueryData.ts | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/packages/hooks/src/data/QueryData.ts b/packages/hooks/src/data/QueryData.ts index 1cb88001e2..d8e8a7e579 100644 --- a/packages/hooks/src/data/QueryData.ts +++ b/packages/hooks/src/data/QueryData.ts @@ -64,14 +64,14 @@ export class QueryData extends OperationData { public executeLazy(): QueryTuple { return !this.runLazy ? [ - this.runLazyQuery, - { - loading: false, - networkStatus: NetworkStatus.ready, - called: false, - data: undefined - } as QueryResult - ] + this.runLazyQuery, + { + loading: false, + networkStatus: NetworkStatus.ready, + called: false, + data: undefined + } as QueryResult + ] : [this.runLazyQuery, this.execute()]; } @@ -98,6 +98,7 @@ export class QueryData extends OperationData { // requests/responses. setTimeout(() => { this.currentObservable.query && + this.currentObservable.query.resetQueryStoreErrors && this.currentObservable.query.resetQueryStoreErrors(); }); } @@ -257,7 +258,7 @@ export class QueryData extends OperationData { // need to log it here. We could conceivably log something if // an option was set. OTOH we don't log errors w/ the original // query. See https://github.com/apollostack/react-apollo/issues/404 - .catch(() => {}); + .catch(() => { }); } } @@ -358,9 +359,9 @@ export class QueryData extends OperationData { result.data = previousData && data ? { - ...previousData, - ...data - } + ...previousData, + ...data + } : previousData || data; } else if (error) { Object.assign(result, {