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

Mutation's invalidateQueries option #448

Closed
Slava opened this issue Jul 22, 2016 · 1 comment
Closed

Mutation's invalidateQueries option #448

Slava opened this issue Jul 22, 2016 · 1 comment

Comments

@Slava
Copy link
Contributor

Slava commented Jul 22, 2016

Right now, a mutation allows you to specify how to update the results of certain queries by supplying a reducer function.

But if it is too complicated, or you just don't care enough to do it, the right way would be to refetch the whole query from scratch. Right now, there is no easy way to do that, but implementing it should be relatively easy:

client.mutate({
  query: gql`...`,
  variables: {/* ... */},
  updateQueries: {/* ... */},
  invalidateQueries: {
    nameOfSomeQuery: true,
  }
});
@Poincare
Copy link
Contributor

Poincare commented Aug 2, 2016

Merged with #482

@Poincare Poincare closed this as completed Aug 2, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants