Skip to content

Commit

Permalink
Merge pull request #319 from tsnieman/patch-1
Browse files Browse the repository at this point in the history
Fix link formatting
  • Loading branch information
Sashko Stubailo authored Sep 6, 2017
2 parents 6204ace + eebe0d3 commit 41b03ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/source/read-and-write.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ client.mutate({

The first `proxy` argument is an instance of [`DataProxy`][] has the same for methods that we just learned exist on the Apollo Client: `readQuery`, `readFragment`, `writeQuery`, and `writeFragment`. The reason we call them on a `proxy` object here instead of on our `client` instance is that we can easily apply optimistic updates (which we will demonstrate in a bit). The `proxy` object also provides an isolated transaction which shields you from any other mutations going on at the same time, and the `proxy` object also batches writes together until the very end.

[`DataProxy`](apollo-client-api.html#DataProxy)
[`DataProxy`]: apollo-client-api.html#DataProxy

If you provide an `optimisticResponse` option to the mutation then the `update` function will be run twice. Once immediately after you call `client.mutate` with the data from `optimisticResponse`. After the mutation successfully executes against the server the changes made in the first call to `update` will be rolled back and `update` will be called with the *actual* data returned by the mutation and not just the optimistic response.

Expand Down

0 comments on commit 41b03ce

Please sign in to comment.