Skip to content

Commit 5e5b8c9

Browse files
committed
Merge branch 'master' into feature/prettier
# Conflicts: # src/core/types.ts
2 parents a9e34ae + adbd81f commit 5e5b8c9

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

docs/src/pages/guides/mutations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ A mutation can only be in one of the following states at any given moment:
4444
- `isError` or `status === 'error'` - The mutation encountered an error
4545
- `isSuccess` or `status === 'success'` - The mutation was successful and mutation data is available
4646

47-
Beyond those primary state, more information is available depending on the state the mutation:
47+
Beyond those primary states, more information is available depending on the state of the mutation:
4848

4949
- `error` - If the mutation is in an `isError` state, the error is available via the `error` property.
5050
- `data` - If the mutation is in a `success` state, the data is available via the `data` property.

docs/src/pages/guides/placeholder-query-data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ In some circumstances, you may be able to provide the placeholder data for a que
4343

4444
```js
4545
function Todo({ blogPostId }) {
46-
const result = useQuery(['blogPost', blogPostId], () => fetch('/blogPosts'), {
46+
const result = useQuery(['blogPost', blogPostId], () => fetch(`/blogPosts/${blogPostId}`), {
4747
placeholderData: () => {
4848
// Use the smaller/preview version of the blogPost from the 'blogPosts' query as the placeholder data for this blogPost query
4949
return queryClient

docs/src/pages/reference/useMutation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ mutate(variables, {
4646
- This function will fire before the mutation function is fired and is passed the same variables the mutation function would receive
4747
- Useful to perform optimistic updates to a resource in hopes that the mutation succeeds
4848
- The value returned from this function will be passed to both the `onError` and `onSettled` functions in the event of a mutation failure and can be useful for rolling back optimistic updates.
49-
- `onSuccess: (data: TData, variables: TVariables, context?: TContext) => Promise<void> | void`
49+
- `onSuccess: (data: TData, variables: TVariables, context?: TContext) => Promise<unknown> | void`
5050
- Optional
5151
- This function will fire when the mutation is successful and will be passed the mutation's result.
5252
- If a promise is returned, it will be awaited and resolved before proceeding
53-
- `onError: (err: TError, variables: TVariables, context?: TContext) => Promise<void> | void`
53+
- `onError: (err: TError, variables: TVariables, context?: TContext) => Promise<unknown> | void`
5454
- Optional
5555
- This function will fire if the mutation encounters an error and will be passed the error.
5656
- If a promise is returned, it will be awaited and resolved before proceeding
57-
- `onSettled: (data: TData, error: TError, variables: TVariables, context?: TContext) => Promise<void> | void`
57+
- `onSettled: (data: TData, error: TError, variables: TVariables, context?: TContext) => Promise<unknown> | void`
5858
- Optional
5959
- This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error
6060
- If a promise is returned, it will be awaited and resolved before proceeding

src/core/types.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -485,18 +485,18 @@ export interface MutationOptions<
485485
data: TData,
486486
variables: TVariables,
487487
context: TContext
488-
) => Promise<void> | void
488+
) => Promise<unknown> | void
489489
onError?: (
490490
error: TError,
491491
variables: TVariables,
492492
context: TContext | undefined
493-
) => Promise<void> | void
493+
) => Promise<unknown> | void
494494
onSettled?: (
495495
data: TData | undefined,
496496
error: TError | null,
497497
variables: TVariables,
498498
context: TContext | undefined
499-
) => Promise<void> | void
499+
) => Promise<unknown> | void
500500
retry?: RetryValue<TError>
501501
retryDelay?: RetryDelayValue<TError>
502502
_defaulted?: boolean
@@ -521,18 +521,18 @@ export interface MutateOptions<
521521
data: TData,
522522
variables: TVariables,
523523
context: TContext
524-
) => Promise<void> | void
524+
) => Promise<unknown> | void
525525
onError?: (
526526
error: TError,
527527
variables: TVariables,
528528
context: TContext | undefined
529-
) => Promise<void> | void
529+
) => Promise<unknown> | void
530530
onSettled?: (
531531
data: TData | undefined,
532532
error: TError | null,
533533
variables: TVariables,
534534
context: TContext | undefined
535-
) => Promise<void> | void
535+
) => Promise<unknown> | void
536536
}
537537

538538
export type MutateFunction<

src/react/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,18 @@ export interface UseMutationOptions<
8282
data: TData,
8383
variables: TVariables,
8484
context: TContext | undefined
85-
) => Promise<void> | void
85+
) => Promise<unknown> | void
8686
onError?: (
8787
error: TError,
8888
variables: TVariables,
8989
context: TContext | undefined
90-
) => Promise<void> | void
90+
) => Promise<unknown> | void
9191
onSettled?: (
9292
data: TData | undefined,
9393
error: TError | null,
9494
variables: TVariables,
9595
context: TContext | undefined
96-
) => Promise<void> | void
96+
) => Promise<unknown> | void
9797
retry?: RetryValue<TError>
9898
retryDelay?: RetryDelayValue<TError>
9999
useErrorBoundary?: boolean

0 commit comments

Comments
 (0)