-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow refetchQueries to refetch observerless queries (again).
This PR is a follow-up to PR #8825, which was first released in Apollo Client v3.4.14. As a number of commenters have reported in issue #5419, it appears we did not completely fix the problem, so this PR attempts to finish that work. Since ObservableQuery redelivers the most recent result/error to new subscribers, it is not completely pointless to refetch an ObservableQuery that (currently) has no subscribers. However, putting the ObservableQuery in "standby" mode by setting the obsQuery.options.fetchPolicy to "standby" should still exclude the ObservableQuery from "active" status as far as refetchQueries is concerned. This logic handles useLazyQuery queries that have not yet been executed, since they start out in "standby" mode until called.
- Loading branch information
Showing
3 changed files
with
9 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters