Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset query store errors via ObservableQuery.resetQueryStoreErrors #4941

Merged
merged 4 commits into from
Jun 17, 2019

Conversation

hwillson
Copy link
Member

@hwillson hwillson commented Jun 10, 2019

React Apollo relies on the ObervableQuery->getCurrentResult method to retrieve query results to show within its components. When an error occurs while fetching results, that error is stored in the query store that each ObservableQuery instance is configured to use. Unfortunately, getCurrentResult will only retrieve subsequent valid results if no error exists in the query store. ObservableQuery doesn't currently provide a way to clear out query store errors, which means when React Apollo originating requests that cause an error occur, the error is stored, and future valid requests can no longer be processed.

This commit adds a resetQueryStoreErrors method to the ObservableQuery public API, that will allow React Apollo (and other consumers) to be able to clear out query store errors.

Related to: apollographql/react-apollo#3090

React Apollo relies on the `ObervableQuery->getCurrentResult`
method to retrieve query results to show within its components.
When an error occurs while fetching results, that error is stored
in the query store that each `ObservableQuery` instance is
configured to use. Unfortunately, `getCurrentResult` will only
retrieve subsequent results if no error exists in the query store.
`ObservableQuery` doesn't currently provide a way to clear out
query store errors, which means when React Apollo originating
requests that cause an error occur, the error is stored, and
future valid requests can no longer be processed.

This commit adds a `resetQueryStoreErrors` method to the
`ObservableQuery` public API, that will allow React Apollo (and
other consumers) to be able to clear out query store errors.

Related to: apollographql/react-apollo#3090
@hwillson hwillson merged commit 93bda88 into master Jun 17, 2019
@hwillson hwillson deleted the hwillson/clear-query-store-errors branch June 17, 2019 21:57
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants