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

Conditionally use AC's ObservableQuery.resetQueryStoreErrors #3151

Merged
merged 2 commits into from
Jun 22, 2019

Conversation

hwillson
Copy link
Member

To fix issue #3090, the ObservableQuery.resetQueryStoreErrors method was introduced in apollo-client 2.6.3. While apollo-client 2.6.3 is a peer dep of the latest version of react-apollo (2.5.7), people who can't update their version of apollo-client to >= 2.6.3 are running into issues when updating to the latest version of react-apollo, since ObservableQuery.resetQueryStoreErrors isn't available to them. Since we can't enforce the version of apollo-client people are using, this commit adjusts the Query component to only use resetQueryStoreErrors if it's available. If it isn't, it will call into the ObservableQuery's private API to do the same things as resetQueryStoreErrors. This is a hack, but it is temporary as react-apollo is launching soon, and will enforce a minimum apollo-client version of 2.6.3 (so this workaround won't be needed).

Fixes #3148.

hwillson added 2 commits June 21, 2019 20:43
To fix issue #3090, the `ObservableQuery.resetQueryStoreErrors`
method was introduced in `apollo-client` 2.6.3. While
`apollo-client` 2.6.3 is a peer dep of the latest version of
`react-apollo` (2.5.7), people who can't update their version
of `apollo-client` to >= 2.6.3 are running into issues when
updating to the latest version of `react-apollo`, since
`ObservableQuery.resetQueryStoreErrors` isn't available to them.
Since we can't enforce the version of `apollo-client` people are
using, this commit adjusts the `Query` component to only use
`resetQueryStoreErrors` if it's available. If it isn't, it will
call into the `ObservableQuery`'s private API to do the same
things as `resetQueryStoreErrors`. This is a hack, but it is
temporary as `react-apollo` is launching soon, and will enforce
a minimum `apollo-client` version of 2.6.3 (so this workaround
won't be needed).

Fixes #3148.
@hwillson hwillson merged commit 32423cd into release-2-maintenance Jun 22, 2019
@hwillson hwillson deleted the hwillson/issue-3148 branch June 22, 2019 01:04
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.

1 participant