MCPcopy Create free account
hub / github.com/TanStack/query / constructor

Method constructor

packages/query-core/src/query.ts:306–320  ·  view source on GitHub ↗
(config: QueryConfig<TQueryFnData, TError, TData, TQueryKey>)

Source from the content-addressed store, hash-verified

304 #abortSignalConsumed: boolean
305
306 constructor(config: QueryConfig<TQueryFnData, TError, TData, TQueryKey>) {
307 super()
308
309 this.#abortSignalConsumed = false
310 this.#defaultOptions = config.defaultOptions
311 this.setOptions(config.options)
312 this.observers = []
313 this.#client = config.client
314 this.#cache = this.#client.getQueryCache()
315 this.queryKey = config.queryKey
316 this.queryHash = config.queryHash
317 this.#initialState = getDefaultState(this.options)
318 this.state = config.state ?? this.#initialState
319 this.scheduleGc()
320 }
321 /**
322 * The `meta` object passed in the query's options, if any.
323 * @returns The query's `meta`, or `undefined` if none was set.

Callers

nothing calls this directly

Calls 3

setOptionsMethod · 0.95
getQueryCacheMethod · 0.80
getDefaultStateFunction · 0.70

Tested by

no test coverage detected