-
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.
react: MutationResult.client is always set (#6617)
As far as I can tell, whenever a MutationResult is provided to the user of useMutation (or the component or HOC), it always contains a `client`; eg, OperationData.refreshClient checks this invariant. MutationResult is also used to type an internal state variable used by MutationData and useMutation; this one doesn't contain a `client`. This PR changes that variable to different type without `client`, and the actual exposed MutationResult now has a non-optional `client`. This makes it match `QueryResult`. Now TypeScript consumers of `useMutation` don't need to check to see if `client` exists before using it.
- Loading branch information
Showing
3 changed files
with
16 additions
and
9 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