Skip to content

Commit

Permalink
chore: add minVersion to docs for bailing out of optimistic updates (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
alessbell authored Mar 12, 2024
1 parent d2f7fe9 commit 765a94d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/source/performance/optimistic-ui.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,12 @@ As this example shows, the value of `optimisticResponse` is an object that match

5. Apollo Client notifies all affected queries again. The associated components re-render, but if the server's response matches our `optimisticResponse`, this is invisible to the user.

<MinVersion version="3.9.0">

## Bailing out of an optimistic update

</MinVersion>

In some cases you may want to skip an optimistic update. For example, you may want to perform an optimistic update _only_ when certain variables are passed to the mutation. To skip an update, pass a function to the `optimisticResponse` option and return the `IGNORE` sentinel object available on the second argument to bail out of the optimistic update.

Consider this example:
Expand Down

0 comments on commit 765a94d

Please sign in to comment.