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

chore: add docs for skipping an optimistic update via optimisticResponse #11461

Merged
merged 2 commits into from
Jan 3, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
chore: make PR review updates
  • Loading branch information
alessbell committed Jan 3, 2024
commit 83cc8331e17556e7424c843647893bd243a638d4
2 changes: 1 addition & 1 deletion docs/source/performance/optimistic-ui.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ As this example shows, the value of `optimisticResponse` is an object that match

## Bailing out of an optimistic update

In some cases you may want to skip an optimisitic update. For example, you may want to perform an optimistic update _only_ when certain variables are passed to the mutation. In order to skip an update, you can pass a function to `optimisticResponse` and use the `IGNORE` sentinel object available on the second argument passed to your `optimisticResponse` function to bail out of the optimistic update.
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