We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f454bf1 commit 8927e4cCopy full SHA for 8927e4c
1 file changed
packages/react-query/src/useBaseQuery.ts
@@ -49,6 +49,10 @@ export function useBaseQuery<
49
const errorResetBoundary = useQueryErrorResetBoundary()
50
const defaultedOptions = client.defaultQueryOptions(options)
51
52
+ ;(client.getDefaultOptions() as any)._experimental_beforeQuery?.(
53
+ defaultedOptions,
54
+ )
55
+
56
// Make sure results are optimistically set in fetching state before subscribing or updating options
57
defaultedOptions._optimisticResults = isRestoring
58
? 'isRestoring'
@@ -121,6 +125,8 @@ export function useBaseQuery<
121
125
throw result.error
122
126
}
123
127
128
+ ;(client.getDefaultOptions() as any).afterQuery?.(defaultedOptions, result)
129
124
130
// Handle result property usage tracking
131
return !defaultedOptions.notifyOnChangeProps
132
? observer.trackResult(result)
0 commit comments