Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

fix: add check for resetQueryStoreErrors in afterExecute #3599

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions packages/hooks/src/data/QueryData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ export class QueryData<TData, TVariables> extends OperationData {
public executeLazy(): QueryTuple<TData, TVariables> {
return !this.runLazy
? [
this.runLazyQuery,
{
loading: false,
networkStatus: NetworkStatus.ready,
called: false,
data: undefined
} as QueryResult<TData, TVariables>
]
this.runLazyQuery,
{
loading: false,
networkStatus: NetworkStatus.ready,
called: false,
data: undefined
} as QueryResult<TData, TVariables>
]
: [this.runLazyQuery, this.execute()];
}

Expand All @@ -98,6 +98,7 @@ export class QueryData<TData, TVariables> extends OperationData {
// requests/responses.
setTimeout(() => {
this.currentObservable.query &&
this.currentObservable.query.resetQueryStoreErrors &&
this.currentObservable.query.resetQueryStoreErrors();
});
}
Expand Down Expand Up @@ -257,7 +258,7 @@ export class QueryData<TData, TVariables> 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(() => { });
}
}

Expand Down Expand Up @@ -358,9 +359,9 @@ export class QueryData<TData, TVariables> extends OperationData {
result.data =
previousData && data
? {
...previousData,
...data
}
...previousData,
...data
}
: previousData || data;
} else if (error) {
Object.assign(result, {
Expand Down