()
| 459 | |
| 460 | // Create fetch function |
| 461 | const fetchFn = () => { |
| 462 | const queryFn = ensureQueryFn(this.options, fetchOptions) |
| 463 | |
| 464 | // Create query function context |
| 465 | const createQueryFnContext = (): QueryFunctionContext<TQueryKey> => { |
| 466 | const queryFnContext: OmitKeyof< |
| 467 | QueryFunctionContext<TQueryKey>, |
| 468 | 'signal' |
| 469 | > = { |
| 470 | client: this.#client, |
| 471 | queryKey: this.queryKey, |
| 472 | meta: this.meta, |
| 473 | } |
| 474 | addSignalProperty(queryFnContext) |
| 475 | return queryFnContext as QueryFunctionContext<TQueryKey> |
| 476 | } |
| 477 | |
| 478 | const queryFnContext = createQueryFnContext() |
| 479 | |
| 480 | this.#abortSignalConsumed = false |
| 481 | if (this.options.persister) { |
| 482 | return this.options.persister( |
| 483 | queryFn, |
| 484 | queryFnContext, |
| 485 | this as unknown as Query, |
| 486 | ) |
| 487 | } |
| 488 | |
| 489 | return queryFn(queryFnContext) |
| 490 | } |
| 491 | |
| 492 | // Trigger behavior hook |
| 493 | const createFetchContext = (): FetchContext< |
no test coverage detected