Skip to content

Commit

Permalink
better document throwOnError's default
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexErrant committed Jan 24, 2025
1 parent 12d4542 commit 5b0c269
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/framework/react/reference/useMutation.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ mutate(variables, {
- Defaults to a unique id (so that all mutations run in parallel)
- Mutations with the same scope id will run in serial
- `throwOnError: undefined | boolean | (error: TError) => boolean`
- Defaults to the global query config's `throwOnError` value, which is `undefined`
- Defaults to the global `QueryClient`'s `defaultOptions.queries.throwOnError`.
- Set this to `true` if you want mutation errors to be thrown in the render phase and propagate to the nearest error boundary
- Set this to `false` to disable the behavior of throwing errors to the error boundary.
- If set to a function, it will be passed the error and should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`)
Expand Down
2 changes: 1 addition & 1 deletion docs/framework/react/reference/useQuery.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ const {
- Defaults to `true`
- If set to `false`, this instance of `useQuery` will not be subscribed to the cache. This means it won't trigger the `queryFn` on its own, and it won't receive updates if data gets into cache by other means.
- `throwOnError: undefined | boolean | (error: TError, query: Query) => boolean`
- Defaults to the global query config's `throwOnError` value, which is `undefined`
- Defaults to the global `QueryClient`'s `defaultOptions.queries.throwOnError`.
- Set this to `true` if you want errors to be thrown in the render phase and propagate to the nearest error boundary
- Set this to `false` to disable `suspense`'s default behavior of throwing errors to the error boundary.
- If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`)
Expand Down
2 changes: 1 addition & 1 deletion docs/framework/solid/reference/createQuery.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ function App() {
- The time in milliseconds after data is considered stale. This value only applies to the hook it is defined on.
- If set to `Infinity`, the data will never be considered stale
- ##### `throwOnError: undefined | boolean | (error: TError, query: Query) => boolean`
- Defaults to the global query config's `throwOnError` value, which is `undefined`
- Defaults to the global `QueryClient`'s `defaultOptions.queries.throwOnError`.
- Set this to `true` if you want errors to be thrown in the render phase and propagate to the nearest error boundary
- Set this to `false` to disable `suspense`'s default behavior of throwing errors to the error boundary.
- If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`)
Expand Down

0 comments on commit 5b0c269

Please sign in to comment.