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

react: MutationResult.client is always set #6617

Merged
merged 2 commits into from
Jul 20, 2020

Commits on Jul 20, 2020

  1. react: MutationResult.client is always set

    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.
    glasser authored and benjamn committed Jul 20, 2020
    Configuration menu
    Copy the full SHA
    d3d2060 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    50d3217 View commit details
    Browse the repository at this point in the history