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

Fix mutation error action before reject ApolloError #1398

Merged
merged 6 commits into from
Mar 17, 2017

Conversation

cncolder
Copy link
Contributor

@cncolder cncolder commented Mar 10, 2017

  • If this PR is a new feature, reference an issue where a consensus about the design was reached (not necessary for small changes)
  • Make sure all of the significant new logic is covered by tests
  • Rebase your changes on master so that they can be merged easily
  • Make sure all tests and linter rules pass
  • Update CHANGELOG.md with your change
  • Add your name and email to the AUTHORS file (optional)
  • If this was a change that affects the external API, update the docs and post a link to the PR in the discussion

This patch fix issue #1386

We need dispatch  APOLLO_MUTATION_ERROR before reject ApolloError. This error throw from server side with status code 2xx.

This patch fix optimistic response rollback issue apollographql#1386
@apollo-cla
Copy link

@cncolder: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/

@helfer
Copy link
Contributor

helfer commented Mar 10, 2017

@cncolder Thanks for the PR! Please also add a test that fails without this code change! It could go in the test/client.ts file. You can simply check if the store still contains the optimistic update after the server (mockNetworkInterface) sent back a response with GraphQL errors.

@cncolder
Copy link
Contributor Author

test added

@helfer helfer merged commit ec9437f into apollographql:master Mar 17, 2017
@helfer
Copy link
Contributor

helfer commented Mar 17, 2017

Looks good now, thanks a lot @cncolder ! 🙂

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 2, 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

Successfully merging this pull request may close these issues.

3 participants