File tree 1 file changed +13
-1
lines changed
src/lib/queries/client/queries/query/execution
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import { delayUntilFocus } from "../delayUntilFocus"
19
19
import { retryBackoff } from "../../../../../utils/operators/retryBackoff"
20
20
import { delayOnNetworkMode } from "../delayOnNetworkMode"
21
21
import { completeFnIfNotMoreObservers } from "./completeFnIfNotMoreObservers"
22
+ import { skipToken } from "../../utils"
22
23
23
24
export const executeQuery = <
24
25
TQueryFnData = unknown ,
@@ -39,8 +40,19 @@ export const executeQuery = <
39
40
const defaultFn = async ( ) =>
40
41
await Promise . reject ( new Error ( "No query found" ) )
41
42
43
+ if ( process . env . NODE_ENV !== "production" ) {
44
+ if ( options . queryFn === skipToken ) {
45
+ console . error (
46
+ `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${ options . queryHash } '`
47
+ )
48
+ }
49
+ }
50
+
42
51
let fnIsComplete = false
43
- const queryFn = options . queryFn ?? defaultFn
52
+ const queryFn =
53
+ options . queryFn && options . queryFn !== skipToken
54
+ ? options . queryFn
55
+ : defaultFn
44
56
const abortController = new AbortController ( )
45
57
46
58
const queryFnContext : Omit < QueryFunctionContext < TQueryKey > , "signal" > = {
You can’t perform that action at this time.
0 commit comments