-
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.
Determine queryInfo.queryId in QueryInfo constructor.
This refactoring ensures `observableQuery.queryId` ends up the same as `observableQuery.queryInfo.queryId`, which is relevant in cases when we choose a specific query ID string before creating the `QueryInfo` and `ObservableQuery` objects. Ensuring that `queryInfo.queryId === queryInfo.observableQuery.queryId` (another way of saying the same thing) also fixes the `invariant` failures I deliberately introduced in the previous commit. This inconsistency between IDs was the cause of issue #8586, a double registration bug for mutation `refetchQueries` specified using the legacy one-time `refetchQueries: [{ query, variables }]` style. Another (recommended) way to work around that problem would be to specify `refetchQueries: [query]` instead, to select the existing query by its `DocumentNode` rather than creating and deleting a new one-time legacy query.
- Loading branch information
Showing
3 changed files
with
12 additions
and
4 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